Check provider logo

Virtual Machine uses an approved custom machine image

vm_ensure_using_approved_images

Severityhigh
Servicevm
by Prowler

Azure VMs are evaluated for use of an approved custom image by inspecting the VM image reference. The expected format is a subscription-scoped ID like /subscriptions/.../providers/Microsoft.Compute/images/<image>, not marketplace, gallery, or community sources.

Risk

Using unapproved images undermines integrity and confidentiality by introducing unknown packages, misconfigurations, or malware. Attackers can implant backdoors, weaken hardening, and bypass baselines, enabling data exfiltration and lateral movement, and harming availability with unpatched software.

Run this check with Prowler CLI

prowler azure --checks vm_ensure_using_approved_images

Recommendation

Standardize on golden images maintained in an Azure Compute Gallery or managed images.

  • Harden and patch each release; scan for vulnerabilities
  • Restrict who can create/publish images (least privilege)
  • Enforce deployments only from approved images via policy
  • Version, sign, and retire images regularly

Remediation

CLI

az vm create --resource-group <RESOURCE_GROUP> --name <VM_NAME> --image /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.Compute/images/<IMAGE_NAME> --admin-username azureuser --generate-ssh-keys

Native IaC
Terraform
Other
  1. In Azure Portal, go to Virtual machines > Create > Azure virtual machine
  2. Under Image, click See all images, then select the My Images tab
  3. Choose the approved managed image (type: Microsoft.Compute/images)
  4. Complete required basics and create the VM
  5. If replacing a non-compliant VM, migrate workload and delete the old VM

Source Code

Resource Type

microsoft.compute/virtualmachines

References