Gallery › SQL › Azure built-in policies
Azure SQL Database should be running TLS version 1.2 or newer
Converted Policy Audit Deny Disabled Mode Indexed Version 2.0.0
Setting TLS version to 1.2 or newer improves security by ensuring your Azure SQL Database can only be accessed from clients using TLS 1.2 or newer. Using versions of TLS less than 1.2 is not recommended since they have well documented security vulnerabilities.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONSqlServer_MiniumTLSVersion_Audit.json · 58 lines
{
"properties": {
"displayName": "Azure SQL Database should be running TLS version 1.2 or newer",
"description": "Setting TLS version to 1.2 or newer improves security by ensuring your Azure SQL Database can only be accessed from clients using TLS 1.2 or newer. Using versions of TLS less than 1.2 is not recommended since they have well documented security vulnerabilities.",
"policyType": "BuiltIn",
"mode": "Indexed",
"metadata": {
"version": "2.0.0",
"category": "SQL"
},
"version": "2.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled",
"Deny"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Sql/servers"
},
{
"anyOf": [
{
"field": "Microsoft.Sql/servers/minimalTlsVersion",
"exists": false
},
{
"field": "Microsoft.Sql/servers/minimalTlsVersion",
"less": "1.2"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"2.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/32e6bbec-16b6-44c2-be37-c5b672d103cf",
"name": "32e6bbec-16b6-44c2-be37-c5b672d103cf"
}Bylaw32e6bbec-16b6-44c2-be37-c5b672d103cf.bylaw.ps1 · 32 lines
# Converted from SqlServer_MiniumTLSVersion_Audit.json by ConvertTo-Bylaw.
Policy '32e6bbec-16b6-44c2-be37-c5b672d103cf' {
Properties @{
DisplayName = 'Azure SQL Database should be running TLS version 1.2 or newer'
Description = 'Setting TLS version to 1.2 or newer improves security by ensuring your Azure SQL Database can only be accessed from clients using TLS 1.2 or newer. Using versions of TLS less than 1.2 is not recommended since they have well documented security vulnerabilities.'
Version = '2.0.0'
Category = 'SQL'
PolicyVersion = '2.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Disabled', 'Deny')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Sql/servers' {
Require 'minimalTlsVersion exists' {
Field minimalTlsVersion | Must -Exist
}
Require 'minimalTlsVersion is at least 1.2' {
Field minimalTlsVersion | Must -BeGreaterOrEqual '1.2' -IfPresent
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/SQL/SqlServer_MiniumTLSVersion_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw