Write a query to see what disks are encrypted with ADE verses just the standard SSE with PMK

Parm Dhesi 25 Reputation points
2023-01-21T06:03:28.78+00:00

Hi there - I'm trying to figure out how to search all the disks that have encryption set with ADE and any other type of encryption that is support like CMK.

Thanks

Azure Disk Encryption
Azure Disk Encryption
An Azure service for virtual machines (VMs) that helps address organizational security and compliance requirements by encrypting the VM boot and data disks with keys and policies that are controlled in Azure Key Vault.
162 questions
Azure Data Explorer
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
493 questions
{count} votes

Accepted answer
  1. shiva patpi 13,146 Reputation points Microsoft Employee
    2023-01-24T20:25:15.68+00:00

    Hello @Parm Dhesi ,

    After looking at the additional settings for those disks (i.e. disk with SSE with PMK & ADE vs SSE with PMK) , the only different which I observed was :

    for PMK with ADE - in the properties of the disk you will see diskEncryptionKey attribute

    for PMK with SSE - in the properties of the disk there won't be key

    Having said that , I was thinking of below modified queries to find out those types of disks

    resources | where type == "microsoft.compute/disks"

    | extend properties=parse_json(properties)

    | where properties.encryption["type"] == "EncryptionAtRestWithPlatformKey"

    | where properties.encryptionSettingsCollection["enabled"] == "true"

    | project name, properties

    User's image

    Kindly let me know if you have additional questions !

    regards,

    Shiva.

    4 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. shiva patpi 13,146 Reputation points Microsoft Employee
    2023-01-21T19:29:12.8666667+00:00

    Hello @Parm Dhesi ,

    Can you try out the below steps , see if those helps !
    

    I just tried out locally and below are the results with screen shots. Let me know if that helps or if you have any additional questions !

    Go to "Azure Resource Graph Explorer" on the Azure Portal

    Below query will give you all the disk details:

    resources | where type == "microsoft.compute/disks"

    | extend properties=parse_json(properties)

    | project name, properties.encryption

    User's image

    ////////////////////////

    Below query will filter out the search based up on the criteria

    resources | where type == "microsoft.compute/disks"

    | extend properties=parse_json(properties)

    | where properties.encryption["type"] == "EncryptionAtRestWithCustomerKey"

    | project name, properties.encryption

    User's image

    Regards,

    Shiva.

    1 person found this answer helpful.

  2. Parm Dhesi 25 Reputation points
    2023-01-23T18:35:27.91+00:00

    @shiva patpi Thanks for your assistance I was only able to have results with "EncryptionAtRestWithPlatformKey" but I know I have another type of encryption enabled. Please see my attached picture. How can I query "SSE with PMK & ADE" diskes for all the VM's.

    User's image