Gallery › App Service › Azure built-in policies
App Service Environment apps should not be reachable over public internet
Converted Policy Audit Deny Disabled Mode Indexed Version 3.0.0
To ensure apps deployed in an App Service Environment are not accessible over public internet, one should deploy App Service Environment with an IP address in virtual network. To set the IP address to a virtual network IP, the App Service Environment must be deployed with an internal load balancer.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONHostingEnvironment_InternalLoadBalancingMode_Audit.json · 66 lines
{
"properties": {
"displayName": "App Service Environment apps should not be reachable over public internet",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "To ensure apps deployed in an App Service Environment are not accessible over public internet, one should deploy App Service Environment with an IP address in virtual network. To set the IP address to a virtual network IP, the App Service Environment must be deployed with an internal load balancer.",
"metadata": {
"version": "3.0.0",
"category": "App Service"
},
"version": "3.0.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Web/hostingEnvironments"
},
{
"field": "kind",
"like": "ASE*"
},
{
"field": "Microsoft.Web/HostingEnvironments/internalLoadBalancingMode",
"notContains": "2"
},
{
"field": "Microsoft.Web/HostingEnvironments/internalLoadBalancingMode",
"notContains": "3"
},
{
"field": "Microsoft.Web/HostingEnvironments/internalLoadBalancingMode",
"notContains": "Web"
},
{
"field": "Microsoft.Web/HostingEnvironments/internalLoadBalancingMode",
"notContains": "Publishing"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"3.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/2d048aca-6479-4923-88f5-e2ac295d9af3",
"name": "2d048aca-6479-4923-88f5-e2ac295d9af3"
}Bylaw2d048aca-6479-4923-88f5-e2ac295d9af3.bylaw.ps1 · 36 lines
# Converted from HostingEnvironment_InternalLoadBalancingMode_Audit.json by ConvertTo-Bylaw.
Policy '2d048aca-6479-4923-88f5-e2ac295d9af3' {
Properties @{
DisplayName = 'App Service Environment apps should not be reachable over public internet'
Description = 'To ensure apps deployed in an App Service Environment are not accessible over public internet, one should deploy App Service Environment with an IP address in virtual network. To set the IP address to a virtual network IP, the App Service Environment must be deployed with an internal load balancer.'
Version = '3.0.0'
Category = 'App Service'
PolicyVersion = '3.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Web/hostingEnvironments' {
When {
Field kind | Must -BeLike 'ASE*'
Field internalLoadBalancingMode | Must -Not -ContainText '2'
Field internalLoadBalancingMode | Must -Not -ContainText '3'
Field internalLoadBalancingMode | Must -Not -ContainText 'Web'
}
Require 'internalLoadBalancingMode contains Publishing' {
Field internalLoadBalancingMode | Must -ContainText 'Publishing'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/App Service/HostingEnvironment_InternalLoadBalancingMode_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw