Gallery › Storage › Azure Community Policy
Storage Account - Customer Managed Keys Queue and Table Storage DENY
Converted Policy Audit Deny Disabled Mode All Version 1.0.0
This Azure Policy denies the deployment of an Azure Storage Account when the 'Enable support for customer-managed keys' setting is set to 'Blobs and files only'.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONazurepolicy.json · 49 lines
{
"name": "5bd0303a-01f1-41d8-a425-7b4c77526849",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "Storage Account - Customer Managed Keys Queue and Table Storage DENY",
"description": "This Azure Policy denies the deployment of an Azure Storage Account when the 'Enable support for customer-managed keys' setting is set to 'Blobs and files only'.",
"metadata": {
"version": "1.0.0",
"category": "Storage"
},
"mode": "All",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Deny, Audit or Disabled the execution of the Policy"
},
"allowedValues": [
"Deny",
"Audit",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"field": "Microsoft.Storage/storageAccounts/encryption.services.queue.enabled",
"exists": "false"
},
{
"field": "Microsoft.Storage/storageAccounts/encryption.services.table.enabled",
"exists": "false"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}Bylaw5bd0303a-01f1-41d8-a425-7b4c77526849.bylaw.ps1 · 31 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy '5bd0303a-01f1-41d8-a425-7b4c77526849' {
Properties @{
DisplayName = 'Storage Account - Customer Managed Keys Queue and Table Storage DENY'
Description = 'This Azure Policy denies the deployment of an Azure Storage Account when the ''Enable support for customer-managed keys'' setting is set to ''Blobs and files only''.'
Version = '1.0.0'
Category = 'Storage'
Mode = 'All'
}
Parameter Effect @{
AllowedValues = @('Deny', 'Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Deny, Audit or Disabled the execution of the Policy'
}
Resource 'Microsoft.Storage/storageAccounts' {
When {
Field encryption.services.queue.enabled | Must -Not -Exist
}
Require 'encryption.services.table.enabled exists' {
Field encryption.services.table.enabled | Must -Exist
}
}
Effect (Param Effect)
}Source: policyDefinitions/Storage/storage-account-customer-managed-keys-queue-and-table-storage-deny/azurepolicy.json in Azure/Community-Policy, under the MIT licence.
Bylaw