Gallery › App Service › Azure Community Policy
Audit App Service vnetRouteAllEnabled
Converted Policy AuditIfNotExists Disabled Mode Indexed Version 1.0.0
Audits that vnetRouteAllEnabled is true, ensuring all traffic originating from App is routed through VNet integration
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONazurepolicy.json · 43 lines
{
"name": "7a27cb4f-ede5-4c82-9393-85e4a0647071",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "Audit App Service vnetRouteAllEnabled",
"description": "Audits that vnetRouteAllEnabled is true, ensuring all traffic originating from App is routed through VNet integration",
"metadata": {
"category": "App Service",
"version": "1.0.0"
},
"mode": "Indexed",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "AuditIfNotExists or Disabled the execution of the Policy"
},
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"defaultValue": "AuditIfNotExists"
}
},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.Web/sites"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Web/sites/config",
"existenceCondition": {
"field": "Microsoft.Web/sites/config/vnetRouteAllEnabled",
"equals": true
}
}
}
}
}
}Bylaw7a27cb4f-ede5-4c82-9393-85e4a0647071.bylaw.ps1 · 26 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy '7a27cb4f-ede5-4c82-9393-85e4a0647071' {
Properties @{
DisplayName = 'Audit App Service vnetRouteAllEnabled'
Description = 'Audits that vnetRouteAllEnabled is true, ensuring all traffic originating from App is routed through VNet integration'
Category = 'App Service'
Version = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'AuditIfNotExists'
DisplayName = 'Effect'
Description = 'AuditIfNotExists or Disabled the execution of the Policy'
}
Resource 'Microsoft.Web/sites'
AuditIfNotExists 'Microsoft.Web/sites/config' -Effect (Param Effect) {
Require 'vnetRouteAllEnabled is true' {
Field vnetRouteAllEnabled | Must -Be $true
}
}
}Source: policyDefinitions/App Service/audit-app-service-vnetrouteallenabled/azurepolicy.json in Azure/Community-Policy, under the MIT licence.
Bylaw