Last active
October 4, 2019 14:27
-
-
Save tknerr/30107e0242db5de280f2e0c16e837d6e to your computer and use it in GitHub Desktop.
Automated way to disable Service Fabric / HTTP.sys server headers via AzureRM template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"apiVersion": "[variables('apiVersionVmss')]", | |
"type": "Microsoft.Compute/virtualMachineScaleSets", | |
"name": "[variables('sfVmssNode1Name')]", | |
"location": "[variables('location')]", | |
"properties": { | |
"virtualMachineProfile": { | |
"extensionProfile": { | |
"extensions": [ | |
{ | |
"name": "AddRegistryKeyToRemoveServerHeaderFromHttpResponse", | |
"properties": { | |
"type": "CustomScriptExtension", | |
"publisher": "Microsoft.Compute", | |
"typeHandlerVersion": "1.3", | |
"autoUpgradeMinorVersion": "true", | |
"settings": { | |
"commandToExecute": "reg query \"HKLM\\System\\CurrentControlSet\\Services\\HTTP\\Parameters\" /v \"DisableServerHeader\" || (reg add \"HKLM\\System\\CurrentControlSet\\Services\\HTTP\\Parameters\" /v \"DisableServerHeader\" /t REG_DWORD /d 2 /f && shutdown /r /f /t 0)" | |
} | |
} | |
}, | |
... | |
], | |
} | |
}, | |
... | |
}, | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment