Skip to main content

More Info:

Enable Disk Encryption recommendations for virtual machines.

Risk Level

Low

Address

Operational Maturity, Security

Compliance Standards

  • HIPAA
  • HITRUST CSF
  • ISO 27001
  • Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework

Triage and Remediation

Remediation

Using Console

To remediate the “Monitor Disk Encryption setting is not enabled” misconfiguration in Azure using the Azure console, follow these steps:
  1. Log in to the Azure portal and navigate to the “Security Center” dashboard.
  2. Click on the “Security policy” tab on the left-hand side of the screen.
  3. Under the “Policy initiatives” section, click on the “Enable monitoring of disk encryption” initiative.
  4. Click on the “Remediate” button at the bottom of the screen.
  5. In the pop-up window, review the remediation steps and click on the “Remediate” button again to confirm.
  6. Wait for the remediation process to complete. This may take several minutes.
  7. Once the remediation process is complete, verify that the “Monitor Disk Encryption setting” is now enabled by navigating to the “Security policy” tab and reviewing the policy compliance status.
By following these steps, you should be able to remediate the “Monitor Disk Encryption setting is not enabled” misconfiguration in Azure using the Azure console.

To remediate the “Monitor Disk Encryption setting is not enabled” misconfiguration in Azure, you can follow the below steps using Azure CLI:
  1. Open Azure CLI in your terminal or command prompt.
  2. Login to your Azure account using the command:
  3. Once you are logged in, set the Azure subscription that you want to work with using the command:
  4. Next, enable the Disk Encryption Monitoring setting for the virtual machines in your Azure account using the command:
    Replace <diagnostic-settings-name> with a name for the diagnostic settings, and <vm-resource-id> with the resource ID of the virtual machine that you want to enable disk encryption monitoring for. Note: If you want to enable disk encryption monitoring for all virtual machines in your Azure account, you can use the command:
    Replace <subscription-id> with your Azure subscription ID.
  5. Verify that the Disk Encryption Monitoring setting is enabled for the virtual machine(s) using the command:
    This command will show the diagnostic settings for the specified virtual machine, including the Disk Encryption Monitoring setting.
That’s it! The “Monitor Disk Encryption setting is not enabled” misconfiguration has been remediated for your Azure virtual machine(s).
To remediate the “Monitor Disk Encryption setting is not enabled” misconfiguration in Azure using Python, you can use the Azure Python SDK to enable disk encryption monitoring for all virtual machines in the subscription. Here are the step-by-step instructions:
  1. Install the Azure Python SDK by running the following command in your terminal:
  2. Authenticate with Azure by creating a Service Principal and setting the environment variables AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_TENANT_ID. You can follow the instructions in the Azure documentation to create a Service Principal: https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-authenticate?tabs=cmd#authenticate-with-a-service-principal
  3. Use the following Python code to enable disk encryption monitoring for all virtual machines in the subscription:
    This code will create an Activity Log alert called “disk-encryption-monitoring” for each virtual machine in the subscription, with the condition that the operation “Microsoft.Compute/virtualMachines/write” succeeds and the resource ID matches the virtual machine. When this condition is met, the alert will trigger an event that enables disk encryption monitoring for the virtual machine.
  4. Save the code to a Python file and run it using the python command in your terminal:
    This will enable disk encryption monitoring for all virtual machines in the subscription.
  • Replace SUBSCRIPTION_ID with the subscription you want Azure Security Center to monitor.
  • If you already manage this exact policy assignment in Terraform, update its parameters block instead of creating a new resource. Changing only parameters is an in-place update and does not cause downtime.
Verification: terraform plan should show either creation of azurerm_subscription_policy_assignment.vm_disk_encryption_monitor with parameters.effect.value = "AuditIfNotExists", or an update changing the existing assignment’s parameters so that effect is "AuditIfNotExists".