Patching Azure machines: the basics
What does an unpatched, unmonitored Azure machine actually look like?
A virtual machine is the place where unpatched code turns into an exploited host, and the exposure shows up in two distinct shapes rather than one setting. The first is the patches themselves: a machine can be missing operating-system updates that close known, published vulnerabilities, and it stays missing them until something installs them. The second is visibility: a machine can lack the Guest Configuration extension and a managed identity, which is the agent that lets Azure read the configuration inside the guest, so you cannot even audit whether it is patched or hardened. Defender for Cloud turns each into its own recommendation, but the underlying risk is the same: a host running code that more attackers can exploit, or that you can no longer see inside, than you meant.
Microsoft Defender for Cloud expresses this as 'System updates should be installed on your machines', which maps to the Microsoft Cloud Security Benchmark control PV-6 (Rapidly and automatically remediate vulnerabilities), and 'Guest Configuration extension should be installed on machines', which maps to PV-2 (Audit and enforce secure configurations). The first is powered by Azure Update Manager and fires when a supported machine is missing an update. The second fires when a machine has no machine configuration agent, so its in-guest posture is a blind spot. They read as two separate problems on the report, but they are one job: keep every machine current on patches, and keep every machine visible enough to prove it.
Most of this exposure is drift, not intent. A VM built from an image that was current at the time and never re-assessed, a fleet that was onboarded before periodic assessment was switched on, an Arc-enabled server that joined without the machine configuration extension. The work is to get every machine reporting its update state through Update Manager, install what is missing, deploy the Guest Configuration extension with a system-assigned managed identity so the audit can run, and then enforce assessment so a machine cannot quietly fall behind again.
In this lesson you will learn how Azure expresses machine patch state and in-guest visibility, how to find every machine that is missing updates or missing the configuration agent across a subscription, and how to bring them current without breaking the few that need careful reboot scheduling. 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.
The patch that shipped before the breach
Some of the most damaging cyber incidents on record exploited vulnerabilities that already had a patch available, sometimes for months. WannaCry tore through unpatched Windows machines in 2017 using a flaw Microsoft had fixed almost two months earlier; the Equifax breach the same year traced back to a known component vulnerability with a patch that had been out for weeks. The pattern is always the same: the fix existed, the machine did not install it, and an automated scanner found the gap before anyone closed it. Azure can now assess and install operating-system updates automatically through Azure Update Manager, but every machine onboarded before that was switched on still needs to be brought into the loop explicitly.
Finding unpatched and unmonitored machines across a subscription
Sam is the security lead at a scale-up preparing for its first ISO 27001 audit. Defender for Cloud shows patch findings spread across two dozen machines in two subscriptions, plus a cluster of machines that have no Guest Configuration extension at all, so their in-guest state is unknown.
Rather than work the findings one by one, Sam starts by listing which machines are even reporting their patch state to Azure Update Manager, because a machine with no periodic assessment is not 'patched', it is simply unmeasured, and that is the gap to close before anything else.
Start by listing each machine's patch assessment mode. A machine on 'ImageDefault' is not being assessed on a schedule, so its update state is stale or unknown.
An internet-facing machine that is not even being assessed for missing updates is the highest-value target in this group. Bring it into Update Manager first, then patch.
How Defender for Cloud decides a machine is unpatched or unmonitoreddeep dive
The patch recommendation resolves to data that Azure Update Manager gathers. Update Manager performs a periodic assessment, by default once every 24 hours, comparing the installed packages on the machine against the available updates from its update source, and reports any that are missing. For that to happen the machine must be on periodic assessment: the 'assessmentMode' property set to 'AutomaticByPlatform' rather than 'ImageDefault'. A machine left on 'ImageDefault' is never assessed on a schedule, so it can be badly behind while showing no recent finding at all. Installation can then be handled by 'patchMode' set to 'AutomaticByPlatform', which lets the platform install patches on a maintenance schedule, or by a one-time Fix from the recommendation.
The configuration recommendation resolves to the Guest Configuration extension, now branded Azure Machine Configuration. The extension (AzurePolicyforWindows or AzurePolicyforLinux) is the agent that reads settings inside the guest, and it has a hard prerequisite: a system-assigned managed identity. A machine that has the extension installed but no system-assigned identity is still non-compliant, because the identity is what authorises the in-guest audit. Without that pairing, Azure cannot read the machine's configuration, so the entire family of in-guest baseline checks is blind on that host.
Defender for Cloud evaluates both against the Microsoft Cloud Security Benchmark on a periodic cycle, so a fix does not flip the recommendation to Healthy instantly. The control-plane change and the agent install are immediate, but the posture catches up on the next assessment. This matters when you are gathering audit evidence against a deadline. The strongest position pairs the per-machine settings with an Azure Policy backstop: built-in DeployIfNotExists policies that enable periodic assessment and deploy the configuration extension with a managed identity to every new machine, so no host can be created outside the loop again.
What is the impact of leaving machines unpatched?
The direct impact is compromise through a known vulnerability. An unpatched, internet-reachable machine is exploitable by anyone who finds it, and internet-facing hosts are found and scanned quickly by automated tooling. The overwhelming majority of machine compromises run through a flaw that already had a patch available: the fix existed, the host did not install it. A machine missing the configuration agent compounds this, because you cannot even see whether it is patched or hardened, so the host is both exposed and invisible.
The second-order impact is blast radius. Every unpatched machine is a foothold that, once taken, lets an attacker move laterally into the rest of the estate. Keeping machines current shrinks that surface to the few hosts you are actively maintaining behind a known schedule, which are the ones you can monitor and reason about. A fleet on automatic assessment and patching is one where a new critical vulnerability is installed everywhere within a known, bounded window rather than whenever someone gets to it.
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 working patch management process: that machines are assessed, that updates are installed on a defined cadence, and that configuration is audited. A passing set of system-update and configuration-extension recommendations across every subscription is the cheapest and most defensible artefact you can hand an auditor.
How do you keep machines patched safely?
Work the capability as one loop rather than chasing individual findings. The order matters: get every machine reporting its state and deploy the audit agent before you start installing, so you patch from a complete and visible inventory rather than a partial one.
1. Inventory every machine by assessment state
List the machines that are on periodic assessment and the ones still on 'ImageDefault', and the machines that have the Guest Configuration extension with a managed identity versus those that do not. Treat this inventory as the source of truth, not the Defender finding count, because a machine that is not being assessed shows no recent patch finding while being badly behind.
2. Bring every machine into Azure Update Manager
Set 'assessmentMode' to 'AutomaticByPlatform' so each machine is assessed daily, and deploy the Guest Configuration extension with a system-assigned managed identity so its in-guest configuration can be audited. For Arc-enabled and multicloud machines, onboard them through Azure Arc first. This is the step that turns 'unmeasured' into 'measured'.
3. Install missing updates, highest risk first
Patch internet-facing and high-severity machines first using a one-time Fix or a scheduled patch run, then work down to internal and non-production hosts. Schedule the reboots that some updates require into a maintenance window rather than installing blind in production. Prioritise by exposure and severity, not by machine name.
4. Ratchet it shut with Azure Policy
Assign the built-in DeployIfNotExists policies that enable periodic assessment, set automatic patching to 'AutomaticByPlatform', and deploy the configuration extension with a managed identity to every new machine. Back this with a maintenance configuration that defines the patch schedule, so a newly created host is current and visible by default rather than by someone remembering to onboard it.
# Bring machines into Azure Update Manager: switch on periodic assessment
# and platform-orchestrated patching, then deploy the audit agent.
for vm in $(az vm list -g rg-workloads --query "[].name" -o tsv); do
az vm update -g rg-workloads -n "$vm" \
--set osProfile.windowsConfiguration.patchSettings.assessmentMode=AutomaticByPlatform \
--set osProfile.windowsConfiguration.patchSettings.patchMode=AutomaticByPlatform
# Guest Configuration extension requires a system-assigned identity.
az vm identity assign -g rg-workloads -n "$vm"
az vm extension set -g rg-workloads --vm-name "$vm" \
--name AzurePolicyforWindows \
--publisher Microsoft.GuestConfiguration
echo "$vm: periodic assessment on, auto-patch on, config extension deployed"
done
# Ratchet it shut: assign the built-in policy that enables periodic
# assessment on every machine in the subscription.
az policy assignment create \
--name enable-periodic-assessment \
--policy 59efceea-0c96-497e-a4a1-4eb2290dac15 \
--scope "/subscriptions/00000000-0000-0000-0000-000000000000" \
--location uksouth --mi-system-assigned Quick quiz
Question 1 of 5Defender for Cloud shows 'System updates should be installed' and 'Guest Configuration extension should be installed' across several machines. What is the most efficient way to think about them?
You scored
0 / 5
Keep learning
Go deeper on how Azure assesses and installs updates and audits in-guest configuration across the settings in this capability.
- Remediate system updates and patches recommendations How the 'System updates should be installed' recommendation works and how to fix it through Azure Update Manager.
- Enable periodic assessment using Azure Policy Set assessment mode to AutomaticByPlatform across a fleet so every machine is checked daily.
- Understand the machine configuration feature of Azure Policy What the Guest Configuration extension does, why it needs a system-assigned managed identity, and how it audits in-guest settings.
You can now treat Azure patching as one capability rather than a scatter of findings: inventory which machines are even being assessed, onboard the whole fleet to Azure Update Manager and deploy the configuration extension so every host is visible, install missing updates highest-risk first into proper maintenance windows, and ratchet the estate shut with Azure Policy so nothing can quietly fall behind. The Controls this lesson covers section below links every recommendation in this group to its deep page and fix.
Back to the library