Virtual machine unattached disk is not encrypted Affecting Compute service in Azure


Severity

0.0
medium
0
10
Severity Framework
Snyk CCSS
Rule category
Data/ Encryption at Rest

Is your environment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
Frameworks
CIS-AzureCIS-ControlsCSA-CCMGDPRHIPAAISO-27001NIST-800-53SOC-2
  • Snyk IDSNYK-CC-00662
  • creditSnyk Research Team

Description

Encrypting the virtual machine's disks ensures that its entire content is fully unrecoverable without a key and thus protects the volume from unwarranted reads.

How to fix?

Set the disk_encryption_set_id attribute to a valid disk encryption set ID, and encryptionSettingsCollection to enabled.

Example configuration:

        {
          "type": "Microsoft.Compute/disks",
          "apiVersion": "2022-07-02",
          "name": "allowed",
          "location": "[resourceGroup().location]",
          "sku": {
            "name": "Standard_LRS"
          },
          "properties": {
            "creationData": {
              "createOption": "Empty"
            },
            "dataAccessAuthMode": "AzureActiveDirectory",
            "diskSizeGB": "128",
            "encryption": {
              "diskEncryptionSetId": "/subscriptions/<subscriptions id >/resourceGroups/<resourceGroups name>/providers/Microsoft.Compute/diskEncryptionSets/662-diskset",
              "type": "EncryptionAtRestWithCustomerKey"
            }
          }
        },
       {
          "type": "Microsoft.Compute/disks",
          "apiVersion": "2022-07-02",
          "name": "allowed_2",
          "location": "[resourceGroup().location]",
          "sku": {
            "name": "Standard_LRS"
          },
          "properties": {
            "creationData": {
              "createOption": "Empty"
            },
            "dataAccessAuthMode": "AzureActiveDirectory",
            "diskSizeGB": "128",
            "encryptionSettingsCollection": {
              "enabled": "true",
              "encryptionSettings": [
                {
                  "diskEncryptionKey": {
                    "secretUrl": "<KeyVault secretURL>",
                    "sourceVault": {
                      "id": "/subscriptions/<subscriptions id >/resourceGroups/<resourceGroups name>/providers/Microsoft.KeyVault/vaults/keyvault-662"
                    }
                  }
                }
              ]
          }
       }
    }