Gallery › Storage › Azure built-in policies
Storage accounts should have the specified minimum TLS version
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Configure a minimum TLS version for secure communication between the client application and the storage account. To minimize security risk, the recommended minimum TLS version is the latest released version, which is currently TLS 1.2.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONStorageAccountMinimumTLSVersion_Audit.json · 71 lines
{
"properties": {
"displayName": "Storage accounts should have the specified minimum TLS version",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Configure a minimum TLS version for secure communication between the client application and the storage account. To minimize security risk, the recommended minimum TLS version is the latest released version, which is currently TLS 1.2.",
"metadata": {
"version": "1.0.0",
"category": "Storage"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the audit policy"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
},
"minimumTlsVersion": {
"type": "String",
"metadata": {
"displayName": "Minimum TLS Version",
"description": "Minimum version of TLS required to access data in this storage account"
},
"allowedValues": [
"TLS1_0",
"TLS1_1",
"TLS1_2"
],
"defaultValue": "TLS1_2"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"anyOf": [
{
"field": "Microsoft.Storage/storageAccounts/minimumTlsVersion",
"notEquals": "[parameters('minimumTlsVersion')]"
},
{
"field": "Microsoft.Storage/storageAccounts/minimumTlsVersion",
"exists": "false"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/fe83a0eb-a853-422d-aac2-1bffd182c5d0",
"name": "fe83a0eb-a853-422d-aac2-1bffd182c5d0"
}Bylawfe83a0eb-a853-422d-aac2-1bffd182c5d0.bylaw.ps1 · 38 lines
# Converted from StorageAccountMinimumTLSVersion_Audit.json by ConvertTo-Bylaw.
Policy 'fe83a0eb-a853-422d-aac2-1bffd182c5d0' {
Properties @{
DisplayName = 'Storage accounts should have the specified minimum TLS version'
Description = 'Configure a minimum TLS version for secure communication between the client application and the storage account. To minimize security risk, the recommended minimum TLS version is the latest released version, which is currently TLS 1.2.'
Version = '1.0.0'
Category = 'Storage'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the audit policy'
}
Parameter MinimumTlsVersion @{
AllowedValues = @('TLS1_0', 'TLS1_1', 'TLS1_2')
Default = 'TLS1_2'
DisplayName = 'Minimum TLS Version'
Description = 'Minimum version of TLS required to access data in this storage account'
}
Resource 'Microsoft.Storage/storageAccounts' {
Require 'minimumTlsVersion is the MinimumTlsVersion parameter' {
Field minimumTlsVersion | Must -Be (Param MinimumTlsVersion)
}
Require 'minimumTlsVersion exists' {
Field minimumTlsVersion | Must -Exist
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Storage/StorageAccountMinimumTLSVersion_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw