Description
Ensure that unattached disks in a subscription are encrypted with a Customer Managed Key (CMK).
Rationaleβ
Managed disks are encrypted by default with Platform-managed keys. Using Customer-managed keys may provide an additional level of security or meet an organization's regulatory requirements. Encrypting managed disks ensures that its entire content is fully unrecoverable without a key and thus protects the volume from unwarranted reads. Even if the disk is not attached to any of the VMs, there is always a risk where a compromised user account with administrative access to VM service can mount/attach these data disks, which may lead to sensitive information disclosure and tampering.
Impactβ
NOTE: You must have your key vault set up to utilize this. Encryption is available only on Standard tier VMs. This might cost you more.
Utilizing and maintaining Customer-managed keys will require additional work to create, protect, and rotate keys.
Auditβ
From Azure Portalβ
- Go to
Disks
. - Click on
Add Filter
. - In the
filter
field selectDisk state
. - In the
Value
field selectUnattached
. - Click
Apply
. - for each disk listed ensure that
Encryption type
in theencryption
blade isEncryption at-rest with a customer-managed key
.
From Azure CLIβ
Ensure command below does not return any output:
az disk list --query '[? diskstate == `Unattached`].{encryptionSettings: encryptionSettings, name: name}' -o json
Sample Output:
[
{
"encryptionSettings": null,
"name": "<Disk1>"
},
{
"encryptionSettings": null,
"name": "<Disk2>"
}
]
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.
- Policy ID: ca91455f-eace-4f96-be59-e6e2c35b4816 - Name:
Managed disks should be double encrypted with both platform-managed and customer-managed keys
Default Valueβ
By default, managed disks are encrypted with a Platform-managed key.
Referencesβ
- https://docs.microsoft.com/en-us/azure/security/fundamentals/azure-disk-encryption-vms-vmss
- https://docs.microsoft.com/en-us/azure/security-center/security-center-disk-encryption?toc=%2fazure%2fsecurity%2ftoc.json
- https://docs.microsoft.com/en-us/rest/api/compute/disks/delete
- https://docs.microsoft.com/en-us/cli/azure/disk?view=azure-cli-latest#az-disk-delete
- https://docs.microsoft.com/en-us/rest/api/compute/disks/update#encryptionsettings
- https://docs.microsoft.com/en-us/cli/azure/disk?view=azure-cli-latest#az-disk-update
- https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-data-protection#dp-5-use-customer-managed-key-option-in-data-at-rest-encryption-when-required