Lesson 2 of 4 Securing Virtual Machines

Implementing Disk Encryption

This lesson compares the disk encryption methods, and explains the move away from Azure Disk Encryption.

Learning outcomes

After completing this lesson, you will be able to:

  • Compare the disk encryption methods.
  • Describe a disk encryption set.
  • Explain the benefits of encryption at host.
  • Explain the retirement of Azure Disk Encryption.

Layers of disk encryption

Encryption at rest protects data if a physical disk or a copy of a virtual disk is taken. Azure offers several mechanisms, and they operate at different points. Some run on the storage service, some on the VM host, and one inside the guest operating system. The point at which encryption happens decides what it can cover. The following comparison sets out the options.

MethodWhere it runsCoversKey options
Server-side encryption (SSE)Azure StorageOS and data disks, not temporary disks or cachesPlatform-managed or customer-managed
Encryption at hostThe VM hostAlso temporary disks and cachesPlatform-managed or customer-managed; temporary disks use platform keys
Azure Disk Encryption (ADE)The guest, with BitLocker or DM-CryptOS and data disksKey Vault, optionally with a key encryption key
Confidential disk encryptionBound to the VM's hardwareOS disk of a confidential VMPlatform-managed or customer-managed

Server-side encryption is always on, using platform-managed keys, so there is no such thing as an unencrypted managed disk. The exam's skill therefore concerns the remaining questions: who controls the key, and what else should be covered?

The following diagram shows where each method runs.

Where each disk encryption method runs. Server-side encryption in Azure Storage is always on and covers OS and data disks, but not temporary disks or caches. Encryption at host runs on the VM host and also covers temporary disks and caches. Azure Disk Encryption runs inside the guest with BitLocker or DM-Crypt and is being retired. Confidential disk encryption binds the OS disk of a confidential VM to its hardware. The key questions are who controls the key and what else is covered.
The layer decides what a method can cover.
Sort into groups

Which encryption method?

Exam skills 3.2.1

Decide which disk encryption method each statement describes.

Log in to try this activity Interactive activities are free with an account.

Customer-managed keys and disk encryption sets

To use a customer-managed key, create a disk encryption set, an Azure resource that points to a key in Key Vault or Managed HSM. The set has a managed identity, which needs access to the key, through Key Vault Crypto Service Encryption User under Azure RBAC. Disks are then created with that set. The vault needs soft delete and purge protection.

Customer-managed keys give control over rotation, and the ability to revoke access. If the key is disabled or removed, then VMs using it stop working. Enabling automatic key version updates on the disk encryption set lets it follow a rotation policy. A disk encryption set on its own does not encrypt temporary disks or caches, so a requirement that covers those needs encryption at host.

True or false

Disk encryption sets

Exam skills 3.2.1

Check how disk encryption sets and customer-managed keys work.

Log in to try this activity Interactive activities are free with an account.

Encryption at host

Encryption at host is the recommended option for new VMs. It encrypts data on the host where the VM runs, so that temporary disks and caches are covered, and data flows encrypted to the storage service. It needs no agent and has no performance cost in the guest. It works with images of any kind, including custom Linux images that ADE cannot handle. Temporary disks use platform-managed keys in all cases.

The feature must be registered on the subscription once, and the VM size must support it.

az feature register --namespace Microsoft.Compute --name EncryptionAtHost
az provider register --namespace Microsoft.Compute
az vm create --resource-group RG --name VM --image Ubuntu2404 --size Standard_D2s_v5 \
  --encryption-at-host true --generate-ssh-keys

Defender for Cloud and Azure Policy can audit whether encryption at host is enabled across a fleet.

Azure Disk Encryption and its retirement

Azure Disk Encryption uses BitLocker on Windows and DM-Crypt on Linux, inside the guest, with keys held in Key Vault. It needs the vault's setting for Azure Disk Encryption and, when a key encryption key is used, a Premium vault. It does not work with custom Linux images.

Microsoft has scheduled ADE for retirement on 15 September 2028. On that date, workloads keep running until they reboot, and then the encrypted disks fail to unlock. It should therefore not be chosen for new deployments, even though it may still appear in older materials.

There is no in-place migration. The documented approach creates new managed disks through the Upload method, copies the VHD data with a 512-byte offset, and uses encryption at host on the replacement VM. On Linux, ADE cannot be disabled on OS disks, so a new VM with a new OS disk is needed. The process requires downtime. After ADE is disabled, the portal shows SSE with platform-managed keys immediately, but operating system decryption needs to be verified, with manage-bde -status on Windows.

Do not choose ADE for new work

If an option offers ADE for a new VM alongside encryption at host, choose encryption at host. ADE is a skill for managing existing systems and for planning migration.

Choosing a method

The following steps give a way of choosing for a new VM.

  1. Is the data confidential from the host?

    If so, use a confidential VM with confidential disk encryption.

  2. Are temporary disks or caches in scope?

    If so, use encryption at host.

  3. Must you control the key?

    If so, add a disk encryption set with a customer-managed key.

  4. Is there no special requirement?

    Encryption at host with platform-managed keys is a simple, strong baseline.

Scenario questions

Choosing disk encryption

Exam skills 3.2.1

Choose the disk encryption approach for each requirement.

Log in to try this activity Interactive activities are free with an account.
Worked example

Covering temporary disks

A new application writes sensitive files to a VM's temporary disk. The company must control the encryption key for the OS and data disks, must be able to revoke it, and wants the temporary disk encrypted too. The image is a custom Linux image. What should you implement?

Use encryption at host to cover the temporary disk, together with a disk encryption set that uses a customer-managed key for the OS and data disks. The temporary disk is encrypted with a platform-managed key, which the scenario accepts, as the key requirement applies to the OS and data disks.

ADE does not support custom Linux images, and it is retiring. A disk encryption set on its own would not cover the temporary disk. SSE with platform-managed keys would not give control of the key.

Check yourself

Does a disk encryption set encrypt a VM's temporary disk?

Show answer

No. It applies to managed disks. Temporary disks need encryption at host.

Exam Tips

Remember for the exam

  • Encryption at host covers temporary disks and caches.
  • A disk encryption set adds a customer-managed key, and needs purge protection on the vault.
  • ADE retires on 15 September 2028, with no in-place migration.
  • Managed disks are always encrypted at rest.