Gallery › Network › Azure built-in policies
Azure Web Application Firewall should be enabled for Azure Front Door entry-points
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.2
Deploy Azure Web Application Firewall (WAF) in front of public facing web applications for additional inspection of incoming traffic. Web Application Firewall (WAF) provides centralized protection of your web applications from common exploits and vulnerabilities such as SQL injections, Cross-Site Scripting, local and remote file executions. You can also restrict access to your web applications by countries, IP address ranges, and other http(s) parameters via custom rules.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
{
"properties": {
"displayName": "Azure Web Application Firewall should be enabled for Azure Front Door entry-points",
"description": "Deploy Azure Web Application Firewall (WAF) in front of public facing web applications for additional inspection of incoming traffic. Web Application Firewall (WAF) provides centralized protection of your web applications from common exploits and vulnerabilities such as SQL injections, Cross-Site Scripting, local and remote file executions. You can also restrict access to your web applications by countries, IP address ranges, and other http(s) parameters via custom rules.",
"policyType": "BuiltIn",
"mode": "Indexed",
"metadata": {
"version": "1.0.2",
"category": "Network"
},
"version": "1.0.2",
"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/frontdoors"
},
{
"field": "Microsoft.Network/frontdoors/frontendEndpoints[*].webApplicationFirewallPolicyLink.id",
"exists": "false"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.2"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/055aa869-bc98-4af8-bafc-23f1ab6ffe2c",
"name": "055aa869-bc98-4af8-bafc-23f1ab6ffe2c"
}# Converted from WAF_AFD_Enabled_Audit.json by ConvertTo-Bylaw.
Policy '055aa869-bc98-4af8-bafc-23f1ab6ffe2c' {
Properties @{
DisplayName = 'Azure Web Application Firewall should be enabled for Azure Front Door entry-points'
Description = 'Deploy Azure Web Application Firewall (WAF) in front of public facing web applications for additional inspection of incoming traffic. Web Application Firewall (WAF) provides centralized protection of your web applications from common exploits and vulnerabilities such as SQL injections, Cross-Site Scripting, local and remote file executions. You can also restrict access to your web applications by countries, IP address ranges, and other http(s) parameters via custom rules.'
Version = '1.0.2'
Category = 'Network'
PolicyVersion = '1.0.2'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Network/frontdoors' {
Require 'frontendEndpoints and webApplicationFirewallPolicyLink.id are as required' {
Count 'frontendEndpoints[*]' -Where {
Field webApplicationFirewallPolicyLink.id | Must -Exist
} | Must -Not -Be 0
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Network/WAF_AFD_Enabled_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw