Gallery › Storage › Azure built-in policies
Storage accounts should have infrastructure encryption (excluding storage accounts managed by Azure Red Hat OpenShift)
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Enable infrastructure encryption for higher level of assurance that the data is secure. When infrastructure encryption is enabled, data in a storage account is encrypted twice. Storage accounts in resource groups managed by Azure Red Hat OpenShift are excluded from evaluation.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONStorageAccountInfrastructureEncryptionEnabledWithAROExcluded_Audit.json · 54 lines
{
"properties": {
"displayName": "Storage accounts should have infrastructure encryption (excluding storage accounts managed by Azure Red Hat OpenShift)",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Enable infrastructure encryption for higher level of assurance that the data is secure. When infrastructure encryption is enabled, data in a storage account is encrypted twice. Storage accounts in resource groups managed by Azure Red Hat OpenShift are excluded from evaluation.",
"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 policy"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"value": "[resourcegroup().managedBy]",
"notContains": "/providers/Microsoft.RedHatOpenShift/"
},
{
"field": "Microsoft.Storage/storageAccounts/encryption.requireInfrastructureEncryption",
"notEquals": "true"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/f87b2739-92be-4121-af7f-39c0a5a24f20",
"name": "f87b2739-92be-4121-af7f-39c0a5a24f20"
}Bylawf87b2739-92be-4121-af7f-39c0a5a24f20.bylaw.ps1 · 32 lines
# Converted from StorageAccountInfrastructureEncryptionEnabledWithAROExcluded_Audit.json by ConvertTo-Bylaw.
Policy 'f87b2739-92be-4121-af7f-39c0a5a24f20' {
Properties @{
DisplayName = 'Storage accounts should have infrastructure encryption (excluding storage accounts managed by Azure Red Hat OpenShift)'
Description = 'Enable infrastructure encryption for higher level of assurance that the data is secure. When infrastructure encryption is enabled, data in a storage account is encrypted twice. Storage accounts in resource groups managed by Azure Red Hat OpenShift are excluded from evaluation.'
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 policy'
}
Resource 'Microsoft.Storage/storageAccounts' {
When {
Arm '[resourcegroup().managedBy]' | Must -Not -ContainText '/providers/Microsoft.RedHatOpenShift/'
}
Require 'encryption.requireInfrastructureEncryption is true' {
Field encryption.requireInfrastructureEncryption | Must -Be 'true'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Storage/StorageAccountInfrastructureEncryptionEnabledWithAROExcluded_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw