Skip to main content
emnode
Compliance

Run vulnerability assessment across Azure

One capability across virtual machines, SQL databases and container images: make sure every resource that can run code is being scanned for known vulnerabilities, and that the findings those scans surface are actually being resolved rather than just collected.

14 min·10 sections·AZURE

Last reviewed

Vulnerability assessment across Azure: the basics

What does an unscanned, unpatched Azure estate actually look like?

A vulnerability is a known defect, a CVE, in something you are running: an unpatched operating system on a virtual machine, an out-of-date library baked into a container image, a misconfigured permission or an old engine on a SQL database. Vulnerability assessment is the capability that finds these before an attacker does, and in Azure it shows up in two distinct shapes rather than one. The first is coverage: is the resource being scanned at all? A virtual machine with no assessment solution attached is a blind spot, which is exactly what 'Machines should have a vulnerability assessment solution' flags. The second is resolution: where scanning is running, are the findings being fixed? 'SQL databases should have vulnerability findings resolved' and 'Azure registry container images should have vulnerabilities resolved' both flag findings that have been detected but left open.

Microsoft Defender for Cloud turns each surface and each resource type into its own recommendation, which is why one busy subscription can fail several vulnerability checks at once and across different services. They read as separate problems on the report, compute here, SQL there, containers somewhere else, but they are one job: get every resource that can run code under a scanner, and then close the loop so the findings those scanners produce are triaged and resolved rather than accumulating. These two shapes line up with two Microsoft Cloud Security Benchmark controls: the coverage recommendation maps to PV-5, perform vulnerability assessments, while the resolution recommendations for SQL and container images map to PV-6, rapidly and automatically remediate vulnerabilities. Assess and remediate are the same discipline applied to different layers of the stack.

Most of the gap is drift and inertia, not intent. A virtual machine spun up before agentless scanning was enabled on the subscription, a container image that was clean when it was built but has accumulated CVEs in its base layers since, a SQL finding that was triaged once and then forgotten. The work is to get coverage to one hundred per cent across virtual machines, registries and databases, decide which findings are genuine risk versus accepted baseline, and drive the real ones down to zero on a schedule rather than letting them pile up.

In this lesson you will learn how Azure delivers vulnerability assessment across virtual machines, SQL databases and container images, how to confirm every resource is actually being scanned, and how to turn a backlog of findings into a triaged, shrinking list rather than an ever-growing one. The Controls this lesson covers section lists every Defender for Cloud recommendation in this capability, each linking to a deep page with the exact check and a copy-and-paste fix.

Fun fact

The patch that was already available

Year after year, breach retrospectives reach the same uncomfortable conclusion: the vulnerability that let the attacker in was already known, and a fix had already shipped. Some of the largest incidents on record, from mass-exploited web framework flaws to ransomware that spread through an unpatched protocol, hit organisations that had the patch available for weeks or months before the attack. Vulnerability assessment does not invent new defences; it tells you which doors are already known to be unlocked, so the only failure left is not walking over and locking them. Azure now scans agentlessly, so the data is there. The remaining gap is acting on it.

Finding vulnerability gaps across a subscription

Sam is the security lead at a scale-up preparing for its first ISO 27001 audit. Defender for Cloud shows vulnerability findings spread across virtual machines, two SQL databases and a container registry, and a worrying number of machines that have no assessment solution attached at all.

Rather than work the findings one by one, Sam starts by separating the two problems: which resources are not being scanned at all, the blind spots, versus which are being scanned but have findings left open. Coverage has to come first, because an unscanned machine reports zero findings for the worst possible reason.

Start by finding the blind spots: machines flagged because they have no vulnerability assessment solution attached. These report zero findings only because nothing is looking.

$ az security assessment list --query "[?metadata.displayName=='Machines should have a vulnerability assessment solution' && status.code=='Unhealthy'].resourceDetails.id" -o tsv
/subscriptions/.../virtualMachines/web-prod-03
/subscriptions/.../virtualMachines/legacy-batch-01
/subscriptions/.../virtualMachines/build-agent-07
# web-prod-03 is internet-facing and unscanned. That is the worst combination: blind on an exposed box.

An internet-facing machine with no scanner attached is the highest-value gap in this group: you have no idea what CVEs it is carrying. Close coverage before you triage findings.

How Defender for Cloud assesses vulnerabilities across three layersdeep dive

Each of the three recommendations resolves to a different scanner doing the same kind of work. For virtual machines, Defender for Servers attaches Microsoft Defender Vulnerability Management, which since the Qualys integration was retired in May 2024 is the default scanner; in Plan 2 it runs agentlessly by taking a snapshot of the disk rather than installing software on the machine, so coverage no longer depends on an agent being healthy. A machine with no scanner attached at all is what 'Machines should have a vulnerability assessment solution' flags, and it is the worst case because it reports zero findings simply because nothing is looking. For SQL, Defender for SQL runs a vulnerability assessment that compares the database against a configuration benchmark; findings you decide are acceptable can be marked as a baseline, after which the scanner reports only deviations from it, which is how 'SQL databases should have vulnerability findings resolved' is meant to reach a clean state without ignoring real risk. For container registries, Defender for Containers scans each image agentlessly within a few hours of it being pushed, using Microsoft Defender Vulnerability Management to find CVEs in the OS and application layers.

Defender for Cloud evaluates these against the Microsoft Cloud Security Benchmark, controls PV-5 for coverage and PV-6 for resolution, on a periodic cycle, so resolving a finding does not flip the recommendation to Healthy instantly. The fix itself, a patch installed, an image rebuilt, a baseline approved, takes effect immediately, but the posture catches up on the next assessment, and a fresh image scan can take a few hours after a push. This matters when you are gathering audit evidence against a deadline.

The strongest position combines coverage with resolution. Turning the plans on gets you visibility, but visibility without a process just produces a growing backlog. The SQL baseline keeps the signal clean by separating accepted findings from new deviations, and an Azure Policy assignment can audit or enforce that the scanning plans stay enabled across every subscription, so a resource cannot quietly become a blind spot. Together that is the difference between knowing what you are running today and guaranteeing that nothing you run goes unscanned tomorrow.

What is the impact of leaving vulnerabilities unassessed?

The direct impact is the most common breach in the world. The overwhelming majority of successful intrusions exploit a known vulnerability for which a patch already existed, which means an unscanned or unpatched resource is not an abstract risk; it is the precise mechanism by which most organisations are actually compromised. An unscanned internet-facing machine is the worst case: you have no idea what CVEs it is carrying, and an attacker with a scanner of their own does.

The second-order impact is compounding debt. Vulnerabilities accumulate: a container image that was clean at build time gains new CVEs as flaws are discovered in its base layers, and a machine that misses a patch cycle falls further behind every month. Without a standing assessment process, the backlog grows silently until an incident forces a frantic, unprioritised catch-up. With one, the work is steady and the exposure is bounded, because you are resolving findings on a schedule before they can be weaponised.

On the compliance side, every modern framework, ISO 27001, SOC 2, HIPAA, PCI DSS and the UK and EU data-protection regimes, expects evidence of a vulnerability management programme: that resources are scanned, that findings are tracked, and that they are remediated within defined timeframes by severity. A passing set of vulnerability recommendations across every subscription, plus a baseline and a documented remediation cadence, is among the most directly demanded artefacts an auditor will ask for, because PV-5 (assess) and PV-6 (remediate) map so cleanly onto what the frameworks require.

How do you get vulnerability assessment under control safely?

Work the capability as one loop rather than chasing individual findings. The order matters: get coverage first, because an unscanned resource reports zero findings for the worst possible reason, then triage and resolve what the scanners surface.

1. Close the coverage gaps first

Find every virtual machine with no assessment solution attached, then enable Defender for Servers Plan 2 so Microsoft Defender Vulnerability Management scans them agentlessly. Do the same for databases with Defender for SQL and for registries with Defender for Containers. An unscanned resource is a blind spot, so coverage comes before triage: you cannot resolve findings you are not generating.

2. Establish a baseline to separate signal from noise

For SQL especially, review the initial findings and mark the ones you have assessed and accepted as a baseline, so the scanner reports only deviations from it afterwards. This stops a one-time wall of low-severity items from drowning out the new, genuine findings that actually need action, without ignoring real risk.

3. Resolve findings by severity, highest exposure first

Patch the machines, rebuild the container images on a current base, and fix the SQL configurations, prioritising critical and exploitable findings on internet-facing or data-bearing resources over low-severity internal ones. Each remediation is engineering work; track it against a service-level target, for example critical findings resolved within a fixed window.

4. Keep coverage from regressing with Azure Policy

Assign Azure Policy to audit or enforce that the Defender for Cloud plans stay enabled across every subscription, so a new subscription or a disabled plan cannot quietly create a blind spot. This turns full coverage from a state you reached once into a guarantee that holds as the estate grows.

# Step 1: close coverage gaps. Enable the scanning plans on the subscription.
SUB="/subscriptions/00000000-0000-0000-0000-000000000000"

az security pricing create --name VirtualMachines --tier Standard
az security pricing create --name SqlServers       --tier Standard
az security pricing create --name Containers       --tier Standard

# Step 2: list the machines that still have no assessment solution attached.
az security assessment list \
  --query "[?metadata.displayName=='Machines should have a vulnerability assessment solution' && status.code=='Unhealthy'].resourceDetails.id" \
  -o tsv

# Step 3: ratchet it shut. Enforce that the plans stay enabled estate-wide,
# so no new subscription can become an unscanned blind spot. Assign the
# built-in initiative 'Configure Microsoft Defender for Cloud plans'
# (DeployIfNotExists), which turns the Servers, SQL and Containers plans
# back on wherever they are missing.
az policy assignment create \
  --name enable-defender-plans \
  --display-name "Configure Microsoft Defender for Cloud plans" \
  --policy-set-definition f08c57cd-dbd6-49a4-a85e-9ae77ac959b0 \
  --scope "$SUB" \
  --mi-system-assigned --location uksouth

Quick quiz

Question 1 of 5

Defender for Cloud shows vulnerability findings across machines, SQL databases and container images, plus several machines with no scanner attached. What is the most efficient way to think about them?

You can now treat vulnerability assessment as one capability rather than a scatter of findings across compute, SQL and containers: close the coverage gaps first so nothing runs unscanned, establish a baseline to separate signal from noise, resolve findings by severity highest-exposure first, and keep coverage from regressing with Azure Policy. The Controls this lesson covers section below links every recommendation in this group to its deep page and fix.

Back to the library

Controls this lesson covers

One capability, many Microsoft Defender for Cloud recommendations. This lesson is the shared playbook; each control below keeps its own deep page with the exact check, severity and a copy-and-paste fix.