Gallery › Network › Azure built-in policies
Azure Web Application Firewall on Azure Application Gateway should have request body inspection enabled
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Ensure that Web Application Firewalls associated to Azure Application Gateways have Request body inspection enabled. This allows the WAF to inspect properties within the HTTP body that may not be evaluated in the HTTP headers, cookies, or URI.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONAzureWAFonAPPGWShouldHaveRequestBodyInspectionEnabled.json · 50 lines
{
"properties": {
"displayName": "Azure Web Application Firewall on Azure Application Gateway should have request body inspection enabled",
"policyType": "BuiltIn",
"version": "1.0.0",
"mode": "Indexed",
"description": "Ensure that Web Application Firewalls associated to Azure Application Gateways have Request body inspection enabled. This allows the WAF to inspect properties within the HTTP body that may not be evaluated in the HTTP headers, cookies, or URI.",
"metadata": {
"version": "1.0.0",
"category": "Network"
},
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies"
},
{
"field": "Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policySettings.requestBodyCheck",
"equals": "false"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/ca85ef9a-741d-461d-8b7a-18c2da82c666",
"name": "ca85ef9a-741d-461d-8b7a-18c2da82c666"
}Bylawca85ef9a-741d-461d-8b7a-18c2da82c666.bylaw.ps1 · 28 lines
# Converted from AzureWAFonAPPGWShouldHaveRequestBodyInspectionEnabled.json by ConvertTo-Bylaw.
Policy 'ca85ef9a-741d-461d-8b7a-18c2da82c666' {
Properties @{
DisplayName = 'Azure Web Application Firewall on Azure Application Gateway should have request body inspection enabled'
Description = 'Ensure that Web Application Firewalls associated to Azure Application Gateways have Request body inspection enabled. This allows the WAF to inspect properties within the HTTP body that may not be evaluated in the HTTP headers, cookies, or URI.'
Version = '1.0.0'
Category = 'Network'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies' {
Require 'policySettings.requestBodyCheck is not false' {
Field policySettings.requestBodyCheck | Must -Not -Be 'false' -IfPresent
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Network/AzureWAFonAPPGWShouldHaveRequestBodyInspectionEnabled.json in Azure/azure-policy, under the MIT licence.
Bylaw