Lesson 4 of 6 Compute Security: EC2, Containers and Lambda

Patching and Managing Configuration at Scale

This lesson explains how patching is centralised, automated and measured across every account, with configuration kept consistent between patches, since unpatched software is one of the most common causes of compromise.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe the Systems Manager capabilities for patching and configuration.
  • Choose between in-place patching and replacing instances.
  • Explain how patch compliance connects to vulnerability findings.

Systems Manager capabilities

Systems Manager provides several capabilities for keeping instances patched and correctly configured. Patch baselines define which patches are approved, for example critical security updates seven days after release, and Patch Manager installs them during maintenance windows. Patch policies, set up through Quick Setup, apply patching across every account and Region in an organisation, with compliance reported in Systems Manager and Security Hub.

State Manager reapplies a desired configuration on a schedule, correcting drift, such as a disabled agent or a changed setting. Inventory records the software installed on each instance, which helps decide which instances a new vulnerability affects. Run Command runs scripts on many instances at once, with rate controls and error thresholds that stop a bad change spreading. The following table summarises the capabilities.

CapabilityUse
Patch baselinesApproved patches, for example critical security updates after 7 days, applied in maintenance windows
Patch policies (Quick Setup)Patch across all accounts and Regions with compliance in Systems Manager and Security Hub
State ManagerKeep configuration consistent on a schedule
InventoryInstalled software, for vulnerability triage
Run CommandScripts at scale with rate controls
Match the pairs

Systems Manager capabilities

Exam skills 3.2.4 · 1.1.5

Match each Systems Manager capability with what it does.

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

Patching in place or replacing instances

Instances can be patched in two ways. In-place patching uses Patch Manager to install updates on running instances, which suits long-lived servers that cannot easily be rebuilt. The immutable approach never changes running instances: EC2 Image Builder builds a new, patched image, and an Auto Scaling instance refresh replaces the old instances with new ones launched from it. Every instance then matches a tested image, which suits Auto Scaling groups and containers. The following table summarises the approaches.

ApproachHowSuited to
In placePatch Manager installs updates on running instancesLong-lived servers
ImmutableEC2 Image Builder builds patched images; an Auto Scaling instance refresh replaces instancesAuto Scaling groups and containers

The following diagram shows a patching timeline that meets a 14-day patching rule across 60 accounts, and its parts.

Meeting a 14-day patching rule across 60 accounts. A custom baseline approves critical and important security updates seven days after release; a Quick Setup patch policy scans daily and installs weekly in every account and Region; compliance in Security Hub and an AWS Config aggregator is the evidence.
The timeline is drawn to scale.
Sort into groups

Patch in place or replace?

Exam skills 3.2.4

Decide whether each workload suits in-place patching or immutable replacement.

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

Connecting patching to vulnerability management

Amazon Inspector reports which instances have vulnerable packages, and Patch Manager compliance reports which are missing patches. Together they show whether patching closes the vulnerabilities that matter, and Security Hub brings both into one view for prioritisation.

True or false

Patching and vulnerabilities together

Exam skills 3.2.4

Check how patching and vulnerability data work together.

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

Organisation-wide patching with evidence

Auditors require critical security patches on every EC2 instance within 14 days of release, across 60 accounts, with evidence. A custom patch baseline approves critical and important security updates seven days after release:

aws ssm create-patch-baseline --name al2023-security --operating-system AMAZON_LINUX_2023 \
  --approval-rules 'PatchRules=[{PatchFilterGroup={PatchFilters=[
      {Key=CLASSIFICATION,Values=[Security]},{Key=SEVERITY,Values=[Critical,Important]}]},
      ApproveAfterDays=7}]'

A Quick Setup patch policy applies the baseline to every account and Region, scanning daily and installing weekly. Patch compliance flows to Security Hub and an AWS Config aggregator, which together provide the evidence, and Inspector findings confirm that the critical vulnerabilities are closed.

Check yourself

How is the whole organisation patched on a schedule?

Show answer

With Patch Manager patch policies, configured through Quick Setup.

Exam Tips

Remember for the exam

  • To patch the whole organisation on a schedule, use Patch Manager patch policies through Quick Setup.
  • Patch baselines decide which patches are approved and when.
  • For immutable infrastructure, rebuild images with Image Builder and use instance refresh.
  • Use Inventory to find installed software during vulnerability triage.
  • Combine Inspector findings with patch compliance to prioritise work.