Gallery › Network › Azure built-in policies
Azure Application Gateway should be deployed with Azure WAF
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Requires Azure Application Gateway resources to be deployed with Azure WAF.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONAzureAppGWShouldBeDeployedWithWAF_Audit.json · 50 lines
{
"properties": {
"displayName": "Azure Application Gateway should be deployed with Azure WAF",
"policyType": "BuiltIn",
"version": "1.0.0",
"mode": "Indexed",
"description": "Requires Azure Application Gateway resources to be deployed with Azure WAF. ",
"metadata": {
"category": "Network",
"version": "1.0.0"
},
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Action taken when WAF is not deployed with a given resource"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Network/applicationGateways"
},
{
"field": "Microsoft.Network/applicationGateways/firewallPolicy.id",
"exists": "false"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/ff1f1879-a60d-4f23-9641-41e7391ec19a",
"name": "ff1f1879-a60d-4f23-9641-41e7391ec19a"
}Bylawff1f1879-a60d-4f23-9641-41e7391ec19a.bylaw.ps1 · 28 lines
# Converted from AzureAppGWShouldBeDeployedWithWAF_Audit.json by ConvertTo-Bylaw.
Policy 'ff1f1879-a60d-4f23-9641-41e7391ec19a' {
Properties @{
DisplayName = 'Azure Application Gateway should be deployed with Azure WAF'
Description = 'Requires Azure Application Gateway resources to be deployed with Azure WAF. '
Category = 'Network'
Version = '1.0.0'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Action taken when WAF is not deployed with a given resource'
}
Resource 'Microsoft.Network/applicationGateways' {
Require 'firewallPolicy.id exists' {
Field firewallPolicy.id | Must -Exist
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Network/AzureAppGWShouldBeDeployedWithWAF_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw