Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tknerr/30107e0242db5de280f2e0c16e837d6e to your computer and use it in GitHub Desktop.
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
{
"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