Gallery › API Management › Azure built-in policies
API Management calls to API backends should not bypass certificate thumbprint or name validation
Converted Policy Audit Deny Disabled Mode All Version 1.0.2
To improve the API security, API Management should validate the backend server certificate for all API calls. Enable SSL certificate thumbprint and name validation.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONBackendCertificateChecks_AuditDeny.json · 58 lines
{
"properties": {
"displayName": "API Management calls to API backends should not bypass certificate thumbprint or name validation",
"policyType": "BuiltIn",
"mode": "All",
"description": "To improve the API security, API Management should validate the backend server certificate for all API calls. Enable SSL certificate thumbprint and name validation.",
"metadata": {
"version": "1.0.2",
"category": "API Management"
},
"version": "1.0.2",
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.ApiManagement/service/backends"
},
{
"anyof": [
{
"field": "Microsoft.ApiManagement/service/backends/tls.validateCertificateChain",
"equals": false
},
{
"field": "Microsoft.ApiManagement/service/backends/tls.validateCertificateName",
"equals": false
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"parameters": {
"effect": {
"type": "string",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled",
"Deny"
],
"defaultValue": "Audit"
}
},
"versions": [
"1.0.2"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/92bb331d-ac71-416a-8c91-02f2cb734ce4",
"name": "92bb331d-ac71-416a-8c91-02f2cb734ce4"
}Bylaw92bb331d-ac71-416a-8c91-02f2cb734ce4.bylaw.ps1 · 33 lines
# Converted from BackendCertificateChecks_AuditDeny.json by ConvertTo-Bylaw.
Policy '92bb331d-ac71-416a-8c91-02f2cb734ce4' {
Properties @{
DisplayName = 'API Management calls to API backends should not bypass certificate thumbprint or name validation'
Description = 'To improve the API security, API Management should validate the backend server certificate for all API calls. Enable SSL certificate thumbprint and name validation.'
Version = '1.0.2'
Category = 'API Management'
PolicyVersion = '1.0.2'
Mode = 'All'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('Audit', 'Disabled', 'Deny')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.ApiManagement/service/backends' {
Require 'tls.validateCertificateChain is not false' {
Field tls.validateCertificateChain | Must -Not -Be $false -IfPresent
}
Require 'tls.validateCertificateName is not false' {
Field tls.validateCertificateName | Must -Not -Be $false -IfPresent
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/API Management/BackendCertificateChecks_AuditDeny.json in Azure/azure-policy, under the MIT licence.
Bylaw