More Info:
Encrypting the IaaS VMs OS disk (boot volume) ensures that its entire content is fully unrecoverable without a key and thus protects the volume from unwarranted reads.Risk Level
HighAddress
SecurityCompliance Standards
- APRA CPS 234 (Australia)
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- DPDPA
- Digital Operational Resilience Act (EU)
- HIPAA
- HITRUST CSF
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Here are the steps to remediate the OS Disks Lacking Encryption misconfiguration in AZURE using the AZURE console:
- Log in to the AZURE portal.
- Navigate to the Virtual Machines blade.
- Select the virtual machine that has the OS Disks Lacking Encryption misconfiguration.
- Click on the “Disks” option under the Settings section.
- Select the OS disk that you want to encrypt.
- Click on the “Disk Encryption” option under the “Settings” section.
- Click on the “Enable” button to enable the disk encryption.
- Choose the encryption type and the encryption key.
- Click on the “Save” button to save the changes.
Using CLI
Using CLI
To remediate the misconfiguration of OS Disks lacking encryption in AZURE using AZURE CLI, you can follow the below steps:
- Open the Azure CLI on your local machine or Azure Cloud Shell.
-
Run the following command to check if the encryption is enabled on the VM:
az vm encryption show --resource-group <resource-group-name> --name <vm-name>Replace<resource-group-name>with the name of the resource group in which the VM is located, and<vm-name>with the name of the VM. -
If encryption is not enabled on the VM, run the following command to enable encryption:
az vm encryption enable --resource-group <resource-group-name> --name <vm-name> --disk-encryption-keyvault <key-vault-name> --key-encryption-keyvault <key-vault-name> --volume-type ALLReplace<resource-group-name>with the name of the resource group in which the VM is located,<vm-name>with the name of the VM, and<key-vault-name>with the name of the key vault where encryption keys are stored. - Once the command is executed successfully, the encryption process will start, and it may take some time depending on the size of the VM.
-
After the encryption process is complete, run the following command to verify that encryption is enabled:
az vm encryption show --resource-group <resource-group-name> --name <vm-name>This command will display the encryption status of the VM. - Finally, confirm that the OS disks are encrypted by logging into the VM and checking the disk properties.
Using Python
Using Python
To remediate the misconfiguration of OS Disks Lacking Encryption in AZURE using python, follow these steps:
- Install the Azure SDK for Python using the following command:
- Import the necessary modules:
- Authenticate to the Azure account using the
DefaultAzureCredentialclass:
- Get a list of all the virtual machines in the subscription:
- For each virtual machine, check if the OS disk is encrypted or not:
- Save the script and run it to remediate the misconfiguration.
Using Terraform
Using Terraform
disk_encryption_set_id on the existing OS disk forces replacement of the OS disk and VM (planned downtime and data loss on that disk), so apply only after backups or migration.For an existing standalone managed OS disk (azurerm_managed_disk), set disk_encryption_set_id similarly on that resource; this also forces disk replacement.Verification: terraform plan should show creation of azurerm_disk_encryption_set.OS_DISK_DES (and its Key Vault/key if new) and an update to the VM (or managed disk) adding disk_encryption_set_id on the OS disk, with a note that the disk and VM will be recreated.
