Gallery › Storage › Azure Community Policy
Storage Account - TLS Setting AUDIT
Converted Policy Audit Disabled Mode All Version 1.0.0
This Azure Policy creates an audit event when the 'Minimum TLS version' setting is not set to 'Version 1.2'.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONazurepolicy.json · 52 lines
{
"name": "0e97a50d-f52c-4d2f-8da7-f894cf2b2071",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "Storage Account - TLS Setting AUDIT",
"description": "This Azure Policy creates an audit event when the 'Minimum TLS version' setting is not set to 'Version 1.2'.",
"metadata": {
"version": "1.0.0",
"category": "Storage"
},
"mode": "All",
"parameters": {
"tlsVersionRequired": {
"type": "String",
"metadata": {
"displayName": "Required TLS Version",
"description": "The TLS version that should be configured on the Storage Account"
},
"defaultValue": "TLS1_2"
},
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Audit or Disabled the execution of the Policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"field": "Microsoft.Storage/storageAccounts/minimumTlsVersion",
"notEquals": "[parameters('tlsVersionRequired')]"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}Bylaw0e97a50d-f52c-4d2f-8da7-f894cf2b2071.bylaw.ps1 · 32 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy '0e97a50d-f52c-4d2f-8da7-f894cf2b2071' {
Properties @{
DisplayName = 'Storage Account - TLS Setting AUDIT'
Description = 'This Azure Policy creates an audit event when the ''Minimum TLS version'' setting is not set to ''Version 1.2''.'
Version = '1.0.0'
Category = 'Storage'
Mode = 'All'
}
Parameter TlsVersionRequired @{
Default = 'TLS1_2'
DisplayName = 'Required TLS Version'
Description = 'The TLS version that should be configured on the Storage Account'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Audit or Disabled the execution of the Policy'
}
Resource 'Microsoft.Storage/storageAccounts' {
Require 'minimumTlsVersion is the TlsVersionRequired parameter' {
Field minimumTlsVersion | Must -Be (Param TlsVersionRequired)
}
}
Effect (Param Effect)
}Source: policyDefinitions/Storage/storage-account-tls-setting-audit/azurepolicy.json in Azure/Community-Policy, under the MIT licence.
Bylaw