Gallery › Network › Azure built-in policies
[Preview]: API Management gateway hostname configurations should use TLS version 1.2 or newer
Converted Policy Audit Deny Disabled Mode All Version 1.0.0-preview Preview
Enforcing TLS 1.2 or newer improves security by ensuring API Management gateway hostname configurations do not accept connections over TLS 1.0 or 1.1, which have well documented security vulnerabilities. This policy audits gateway hostname configurations where TLS 1.0 or TLS 1.1 is explicitly enabled.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONApplicationGateway-TLS_Audit.json · 59 lines
{
"properties": {
"displayName": "[Preview]: API Management gateway hostname configurations should use TLS version 1.2 or newer",
"policyType": "BuiltIn",
"mode": "All",
"description": "Enforcing TLS 1.2 or newer improves security by ensuring API Management gateway hostname configurations do not accept connections over TLS 1.0 or 1.1, which have well documented security vulnerabilities. This policy audits gateway hostname configurations where TLS 1.0 or TLS 1.1 is explicitly enabled.",
"metadata": {
"version": "1.0.0-preview",
"category": "Network",
"preview": true
},
"version": "1.0.0-preview",
"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.ApiManagement/service/gateways/hostnameConfigurations"
},
{
"anyOf": [
{
"field": "Microsoft.ApiManagement/service/gateways/hostnameConfigurations/tls10Enabled",
"equals": "true"
},
{
"field": "Microsoft.ApiManagement/service/gateways/hostnameConfigurations/tls11Enabled",
"equals": "true"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/c8656c68-eb4e-4f72-a90a-54b6bfbd3c33",
"name": "c8656c68-eb4e-4f72-a90a-54b6bfbd3c33"
}Bylawc8656c68-eb4e-4f72-a90a-54b6bfbd3c33.bylaw.ps1 · 33 lines
# Converted from ApplicationGateway-TLS_Audit.json by ConvertTo-Bylaw.
Policy 'c8656c68-eb4e-4f72-a90a-54b6bfbd3c33' {
Properties @{
DisplayName = '[Preview]: API Management gateway hostname configurations should use TLS version 1.2 or newer'
Description = 'Enforcing TLS 1.2 or newer improves security by ensuring API Management gateway hostname configurations do not accept connections over TLS 1.0 or 1.1, which have well documented security vulnerabilities. This policy audits gateway hostname configurations where TLS 1.0 or TLS 1.1 is explicitly enabled.'
Version = '1.0.0-preview'
Category = 'Network'
Preview = $true
PolicyVersion = '1.0.0-preview'
Mode = 'All'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.ApiManagement/service/gateways/hostnameConfigurations' {
Require 'tls10Enabled is not true' {
Field tls10Enabled | Must -Not -Be 'true' -IfPresent
}
Require 'tls11Enabled is not true' {
Field tls11Enabled | Must -Not -Be 'true' -IfPresent
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Network/ApplicationGateway-TLS_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw