Gallery › Mission › Azure built-in policies
App Service app configs should restrict default network access in Mission Platform products and services
Converted Policy Audit Deny Disabled Mode All Version 1.1.0
This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. Configure App Service App Configs to restrict default network access by setting IP Security Restrictions Default Action and SCM IP Security Restrictions Default Action to Deny.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONAppConfigNetAccess_Audit.json · 59 lines
{
"properties": {
"displayName": "App Service app configs should restrict default network access in Mission Platform products and services",
"policyType": "BuiltIn",
"mode": "All",
"description": "This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. Configure App Service App Configs to restrict default network access by setting IP Security Restrictions Default Action and SCM IP Security Restrictions Default Action to Deny.",
"metadata": {
"version": "1.1.0",
"category": "Mission"
},
"version": "1.1.0",
"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.Web/sites/config"
},
{
"anyOf": [
{
"field": "Microsoft.Web/sites/config/ipSecurityRestrictionsDefaultAction",
"equals": "Allow"
},
{
"field": "Microsoft.Web/sites/config/scmIpSecurityRestrictionsDefaultAction",
"equals": "Allow"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.1.0",
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/b546c248-6dee-41e6-82f7-978634aeb73d",
"name": "b546c248-6dee-41e6-82f7-978634aeb73d"
}Bylawb546c248-6dee-41e6-82f7-978634aeb73d.bylaw.ps1 · 32 lines
# Converted from AppConfigNetAccess_Audit.json by ConvertTo-Bylaw.
Policy 'b546c248-6dee-41e6-82f7-978634aeb73d' {
Properties @{
DisplayName = 'App Service app configs should restrict default network access in Mission Platform products and services'
Description = 'This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. Configure App Service App Configs to restrict default network access by setting IP Security Restrictions Default Action and SCM IP Security Restrictions Default Action to Deny.'
Version = '1.1.0'
Category = 'Mission'
PolicyVersion = '1.1.0'
Mode = 'All'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Web/sites/config' {
Require 'ipSecurityRestrictionsDefaultAction is not Allow' {
Field ipSecurityRestrictionsDefaultAction | Must -Not -Be 'Allow' -IfPresent
}
Require 'scmIpSecurityRestrictionsDefaultAction is not Allow' {
Field scmIpSecurityRestrictionsDefaultAction | Must -Not -Be 'Allow' -IfPresent
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Mission/AppConfigNetAccess_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw