Gallery › App Service › Azure built-in policies
[Deprecated]: App Service apps should have Client Certificates (Incoming client certificates) enabled
Converted Policy AuditIfNotExists Disabled Mode Indexed Version 1.1.0-deprecated Deprecated
The policy is deprecated. Please use /providers/Microsoft.Authorization/policyDefinitions/5c8eef54-2020-4bd6-921c-7470989dee37 instead. 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. This policy applies to apps with Http version set to 1.1.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONClientCert_Webapp_Audit.json · 63 lines
{
"properties": {
"displayName": "[Deprecated]: App Service apps should have Client Certificates (Incoming client certificates) enabled",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "The policy is deprecated. Please use /providers/Microsoft.Authorization/policyDefinitions/5c8eef54-2020-4bd6-921c-7470989dee37 instead. 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. This policy applies to apps with Http version set to 1.1.",
"metadata": {
"version": "1.1.0-deprecated",
"category": "App Service",
"deprecated": true
},
"version": "1.1.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "Disabled",
"allowedValues": [
"AuditIfNotExists",
"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')]",
"details": {
"type": "Microsoft.Web/sites/config",
"name": "web",
"existenceCondition": {
"field": "Microsoft.Web/sites/config/web.http20Enabled",
"equals": "true"
}
}
}
},
"versions": [
"1.1.0",
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/19dd1db6-f442-49cf-a838-b0786b4401ef",
"name": "19dd1db6-f442-49cf-a838-b0786b4401ef"
}Bylaw19dd1db6-f442-49cf-a838-b0786b4401ef.bylaw.ps1 · 38 lines
# Converted from ClientCert_Webapp_Audit.json by ConvertTo-Bylaw.
Policy '19dd1db6-f442-49cf-a838-b0786b4401ef' {
Properties @{
DisplayName = '[Deprecated]: App Service apps should have Client Certificates (Incoming client certificates) enabled'
Description = 'The policy is deprecated. Please use /providers/Microsoft.Authorization/policyDefinitions/5c8eef54-2020-4bd6-921c-7470989dee37 instead. 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. This policy applies to apps with Http version set to 1.1.'
Version = '1.1.0-deprecated'
Category = 'App Service'
Deprecated = $true
PolicyVersion = '1.1.0'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'Disabled'
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'
}
}
AuditIfNotExists 'Microsoft.Web/sites/config' -Name 'web' -Effect (Param Effect) {
Require 'web.http20Enabled is true' {
Field web.http20Enabled | Must -Be 'true'
}
}
}Source: built-in-policies/policyDefinitions/App Service/ClientCert_Webapp_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw