5.2.3 Ensure backup data in Recovery Services vaults is encrypted using customer-managed keys (CMK) (Automated)
Description
Recovery Services vaults offer two encryption options: Microsoft-managed keys, which provide automatic encryption without user intervention, and customer-managed keys (CMK), which allow organizations to retain full control over their encryption keys for enhanced security and compliance.
Rationale
Using customer-managed keys (CMKs) to encrypt Recovery Services vaults enhances security by granting organizations complete control over their encryption keys.
Impact
There are costs and configuration overhead associated with setting up and managing customer-managed keys.
Audit Procedure
Audit from Azure Portal
- Go to
Recovery Services vaults. - Click the name of a Recovery Services vault.
- Under
Settings, clickProperties. - Under
Encryption Settings, clickUpdate. - Ensure the box next to
Use your own keyis checked, and a key URI is displayed underEncryption key. - Repeat steps 1-5 for each Recovery Services vault.
Audit from Azure CLI
Run the following command to list Recovery Services vaults:
az backup vault list
For each Recovery Services vault, run the following command:
az backup vault encryption show --resource-group <resource-group> --name <recovery-services-vault>
Ensure that under properties, encryptionAtRestType is set to CustomerManaged, and a key keyUri exists with the value set to a customer-managed key URI.
Audit from PowerShell
Run the following command to list Recovery Services vaults:
Get-AzRecoveryServicesVault
Run the following command to get the Recovery Services vault in a resource group with a given name:
$vault = Get-AzRecoveryServicesVault -ResourceGroupName <resource-group> -Name <recovery-services-vault>
Run the following command to get the encryption setting for the Recovery Services vault:
$vault.Properties.EncryptionProperty.KeyVaultProperties
Ensure that the command returns a customer-managed key URI. Repeat for each Recovery Services vault.
Audit from Azure Policy
If referencing a digital copy of this Benchmark, clicking a Policy ID will open a link to the associated Policy definition in Azure. If referencing a printed copy, you can search Policy IDs from this URL: https://portal.azure.com/#view/Microsoft_Azure_Policy/PolicyMenuBlade/~/Definitions
- Policy ID:
2e94d99a-8a36-4563-bc77-810d8893b671 - Name: '[Preview]: Azure Recovery Services vaults should use customer-managed keys for encrypting backup data'
Expected Result
properties.encryptionAtRestTypeis set toCustomerManaged- A
keyUriexists with the value set to a customer-managed key URI - In Azure Portal,
Use your own keyis checked and a key URI is displayed underEncryption key
Remediation
Note: Once encryption is configured to use a customer-managed key, this setting cannot be reversed.
Remediate from Azure Portal
- Go to
Recovery Services vaults. - Click the name of a Recovery Services vault.
- Under
Settings, clickProperties. - Under
Encryption Settings, clickUpdate. - Check the box next to
Use your own key. - Under
Encryption key, click the radio button next toEnter key URIto provide a known key URI, or click the radio button next toSelect from Key Vaultto select a key from a Key Vault. - If entering a key URI, provide the key URI in the text box under
Key URI. - If selecting a key from a Key Vault, click
select key from Key Vault.- Select
Key vaultorManaged HSM. - Select a key vault or managed HSM.
- Select a key.
- Click
Select.
- Select
- Select a managed identity to use for the encryption key.
- Click
Update. - Repeat steps 1-10 for each Recovery Services vault.
Remediate from Azure CLI
For each Recovery Services vault requiring remediation, run the following command to assign a customer-managed encryption key:
az backup vault encryption update --resource-group <resource-group> --name <recovery-services-vault> --encryption-key-id <cmk-uri> --mi-system-assigned
Note: Use --mi-user-assigned with the above command to provide a UserAssigned Identity Id.
Remediate from PowerShell
For each Recovery Services vault requiring remediation, run the following command to assign a customer-managed encryption key:
Set-AzRecoveryServicesVaultProperty -VaultId <recovery-services-vault-id> -EncryptionKeyId <cmk-uri> -UseSystemAssignedIdentity $true
Note: Use -UseSystemAssignedIdentity $false with the above command and -UserAssignedIdentity to provide a UserAssigned Identity Id.
Default Value
By default, data in the Recovery Services vault is encrypted using Microsoft-managed keys.
References
- https://learn.microsoft.com/en-us/azure/backup/encryption-at-rest-with-cmk
- https://learn.microsoft.com/en-us/cli/azure/backup/vault
- https://learn.microsoft.com/en-us/powershell/module/az.recoveryservices/get-azrecoveryservicesvault
- https://learn.microsoft.com/en-us/powershell/module/az.recoveryservices/set-azrecoveryservicesvaultproperty
- https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities
Additional Information
- This feature can only be applied to new Recovery Services vaults. Unfortunately, vaults that currently contain existing items that are registered or have previously attempted registration are not supported.
- To enable encryption, it is necessary to grant the Recovery Services vault the appropriate permissions to access the encryption key in the key vault. The key can be modified as needed. Refer to the following guide for details: https://learn.microsoft.com/en-us/azure/backup/encryption-at-rest-with-cmk#assign-permissions-to-the-recovery-services-vault-to-access-the-encryption-key-in-azure-key-vault.
- Azure Backup uses system-assigned managed identities and user-assigned managed identities to authenticate the Recovery Services vault to access encryption keys stored in Azure Key Vault. Refer to the following guide for details: https://learn.microsoft.com/en-us/azure/backup/encryption-at-rest-with-cmk#enable-a-managed-identity-for-your-recovery-services-vault.
CIS Controls
| Controls Version | Control | IG 1 | IG 2 | IG 3 |
|---|---|---|---|---|
| v8 | 3.11 Encrypt Sensitive Data at Rest - Encrypt sensitive data at rest on servers, applications, and databases containing sensitive data. Storage-layer encryption, also known as server-side encryption, meets the minimum requirement of this Safeguard. Additional encryption methods may include application-layer encryption, also known as client-side encryption, where access to the data storage device(s) does not permit access to the plain-text data. | X | X | |
| v7 | 14.8 Encrypt Sensitive Information at Rest - Encrypt all sensitive information at rest using a tool that requires a secondary authentication mechanism not integrated into the operating system, in order to access the information. | X |
Profile
Level 2 | Automated