Gallery › App Service › Azure built-in policies
App Service apps should have Client Certificates (Incoming client certificates) enabled
Converted Policy Audit Disabled Mode Indexed Version 1.0.0
Client certificates allow for the app to request a certificate for incoming requests. Only clients that have a valid certificate will be able to reach the app.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONClientCert_Webapp_v2_Audit.json · 53 lines
{
"properties": {
"displayName": "App Service apps should have Client Certificates (Incoming client certificates) enabled",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Client certificates allow for the app to request a certificate for incoming requests. Only clients that have a valid certificate will be able to reach the app.",
"metadata": {
"version": "1.0.0",
"category": "App Service"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Web/sites"
},
{
"field": "kind",
"notContains": "functionapp"
},
{
"field": "Microsoft.Web/sites/clientCertEnabled",
"notEquals": "true"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/5c8eef54-2020-4bd6-921c-7470989dee37",
"name": "5c8eef54-2020-4bd6-921c-7470989dee37"
}Bylaw5c8eef54-2020-4bd6-921c-7470989dee37.bylaw.ps1 · 33 lines
# Converted from ClientCert_Webapp_v2_Audit.json by ConvertTo-Bylaw.
Policy '5c8eef54-2020-4bd6-921c-7470989dee37' {
Properties @{
DisplayName = 'App Service apps should have Client Certificates (Incoming client certificates) enabled'
Description = 'Client certificates allow for the app to request a certificate for incoming requests. Only clients that have a valid certificate will be able to reach the app.'
Version = '1.0.0'
Category = 'App Service'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Web/sites' {
When {
Field kind | Must -Not -ContainText 'functionapp'
}
Require 'clientCertEnabled is true' {
Field clientCertEnabled | Must -Be 'true'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/App Service/ClientCert_Webapp_v2_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw