Gallery › Cosmos DB › Azure built-in policies
Azure Cosmos DB accounts should use customer-managed keys to encrypt data at rest
Converted Policy Audit Deny Disabled Mode Indexed Version 1.1.0
Use customer-managed keys to manage the encryption at rest of your Azure Cosmos DB. By default, the data is encrypted at rest with service-managed keys, but customer-managed keys are commonly required to meet regulatory compliance standards. Customer-managed keys enable the data to be encrypted with an Azure Key Vault key created and owned by you. You have full control and responsibility for the key lifecycle, including rotation and management. Learn more at https://aka.ms/cosmosdb-cmk.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
{
"properties": {
"displayName": "Azure Cosmos DB accounts should use customer-managed keys to encrypt data at rest",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Use customer-managed keys to manage the encryption at rest of your Azure Cosmos DB. By default, the data is encrypted at rest with service-managed keys, but customer-managed keys are commonly required to meet regulatory compliance standards. Customer-managed keys enable the data to be encrypted with an Azure Key Vault key created and owned by you. You have full control and responsibility for the key lifecycle, including rotation and management. Learn more at https://aka.ms/cosmosdb-cmk.",
"metadata": {
"version": "1.1.0",
"category": "Cosmos DB"
},
"version": "1.1.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "The desired effect of the policy."
},
"allowedValues": [
"audit",
"Audit",
"deny",
"Deny",
"disabled",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "Microsoft.DocumentDB/databaseAccounts/keyVaultKeyUri",
"exists": false
},
{
"field": "type",
"equals": "Microsoft.DocumentDB/databaseAccounts"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.1.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/1f905d99-2ab7-462c-a6b0-f709acca6c8f",
"name": "1f905d99-2ab7-462c-a6b0-f709acca6c8f"
}# Converted from Cosmos_CMK_Deny.json by ConvertTo-Bylaw.
Policy '1f905d99-2ab7-462c-a6b0-f709acca6c8f' {
Properties @{
DisplayName = 'Azure Cosmos DB accounts should use customer-managed keys to encrypt data at rest'
Description = 'Use customer-managed keys to manage the encryption at rest of your Azure Cosmos DB. By default, the data is encrypted at rest with service-managed keys, but customer-managed keys are commonly required to meet regulatory compliance standards. Customer-managed keys enable the data to be encrypted with an Azure Key Vault key created and owned by you. You have full control and responsibility for the key lifecycle, including rotation and management. Learn more at https://aka.ms/cosmosdb-cmk.'
Version = '1.1.0'
Category = 'Cosmos DB'
PolicyVersion = '1.1.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('audit', 'Audit', 'deny', 'Deny', 'disabled', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'The desired effect of the policy.'
}
Resource 'Microsoft.DocumentDB/databaseAccounts' {
Require 'keyVaultKeyUri exists' {
Field keyVaultKeyUri | Must -Exist
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Cosmos DB/Cosmos_CMK_Deny.json in Azure/azure-policy, under the MIT licence.
Bylaw