Gallery › App Service › Azure built-in policies
App Service app slots should enable end to end encryption
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Enabling end to end encryption ensures front-end intra-cluster traffic between App Service front-ends and the workers running application workloads is encrypted.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONWebApp_Slot_EndToEndEncryption_Audit.json · 62 lines
{
"properties": {
"displayName": "App Service app slots should enable end to end encryption",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Enabling end to end encryption ensures front-end intra-cluster traffic between App Service front-ends and the workers running application workloads is encrypted.",
"metadata": {
"version": "1.0.0",
"category": "App Service"
},
"version": "1.0.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/slots"
},
{
"field": "kind",
"notContains": "functionapp"
},
{
"anyOf": [
{
"field": "Microsoft.Web/sites/slots/endToEndEncryptionEnabled",
"exists": "false"
},
{
"field": "Microsoft.Web/sites/slots/endToEndEncryptionEnabled",
"notEquals": "true"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/123aed70-491a-4f07-a569-e1f3a8dd651e",
"name": "123aed70-491a-4f07-a569-e1f3a8dd651e"
}Bylaw123aed70-491a-4f07-a569-e1f3a8dd651e.bylaw.ps1 · 36 lines
# Converted from WebApp_Slot_EndToEndEncryption_Audit.json by ConvertTo-Bylaw.
Policy '123aed70-491a-4f07-a569-e1f3a8dd651e' {
Properties @{
DisplayName = 'App Service app slots should enable end to end encryption'
Description = 'Enabling end to end encryption ensures front-end intra-cluster traffic between App Service front-ends and the workers running application workloads is encrypted.'
Version = '1.0.0'
Category = 'App Service'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Web/sites/slots' {
When {
Field kind | Must -Not -ContainText 'functionapp'
}
Require 'endToEndEncryptionEnabled exists' {
Field endToEndEncryptionEnabled | Must -Exist
}
Require 'endToEndEncryptionEnabled is true' {
Field endToEndEncryptionEnabled | Must -Be 'true'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/App Service/WebApp_Slot_EndToEndEncryption_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw