Systems Manager for patching and operations
Patch Manager, State Manager, OpsCenter and Run Command in a detection and response context.
The decision: how do you patch, enforce a desired state and run fixes on instances without opening inbound ports or distributing SSH keys?
Systems Manager is the fix-it layer. It patches, enforces desired state, tracks work items, and runs commands on managed nodes without inbound ports or SSH keys. A node must be managed, which means the SSM Agent runs and an instance profile (for example AmazonSSMManagedInstanceCore) allows it.
Capabilities
| Capability | What to remember |
|---|---|
| Patch Manager | Scans for missing patches, or scans and installs. Driven by patch baselines |
| State Manager | Associations keep nodes in a desired state on a schedule. Prevents drift |
| OpsCenter | Central list of OpsItems with context and runbooks |
| Run Command | Remote execution through the agent. No inbound port, no key pair, needs only an IAM instance profile |
| Automation | Runbooks (SSM documents). Used by Config remediation and OpsCenter |
Patch Manager
- Methods. A patch policy in Quick Setup is recommended and covers an organization. Also maintenance windows, the on-demand Patch now, and a Host Management Quick Setup that only scans.
- A patch baseline is per OS type. It holds auto-approval rules with an optional wait of N days after release, plus approve and reject lists. AWS predefined baselines are examples. Create custom ones.
- Compliance means up to date with the baseline. It does not mean secure. Reports can go to S3 as CSV, and data flows to Security Hub CSPM and Config.
- By default it targets security-related updates. It does not do major OS version upgrades.
- Rate controls: concurrency and error thresholds.
State Manager
An association has an SSM document, parameters, targets (tags, node IDs, resource groups, or all nodes in the Region) and a schedule. It runs at creation and then on the cron or rate schedule. It can enforce things such as an antivirus agent installed, the CloudWatch agent configured, or a security group rule. Outputs can go to S3. It is free to use.
OpsCenter
- OpsItems are created by hand or automatically from CloudWatch alarms in ALARM, EventBridge rules (Security Hub, Health, Config, EC2 state change), and CloudWatch Application Insights.
- Each OpsItem lists related resources (up to 100 ARNs) and helps avoid duplicates. It keeps a 30-day record of runbooks you ran from it.
- SNS can notify on every change. Cross-account work is possible from a designated administrator.
Compromised SSH key pairs
An EC2 key pair puts the public key in ~/.ssh/authorized_keys. A leaked private key means anyone can log in, and you cannot rotate keys without a new login path. Use Run Command to delete the affected public keys from authorized_keys on every running instance. No downtime, no inbound SSH, no key pair needed.
Exam trap
Patch Manager does not find vulnerabilities and does not test patches. Finding CVEs is Inspector. A patched node is compliant with its baseline, not necessarily safe.
Exam signal
"Fix leaked key pairs on running instances without downtime": Run Command to remove the keys. "Keep a setting enforced on all instances and report drift": State Manager association. "Patch everything in the organization on a schedule": Quick Setup patch policy.
Related
Inspector, AWS Config. State Manager is also the way to push one CloudWatch agent configuration to a whole fleet, see Troubleshooting the monitoring pipeline.
Further reading
Troubleshooting the monitoring pipeline
Finding why logs, alarms and alerts go missing, from the CloudWatch agent and Lambda or API Gateway logging to trail and bucket policies, KMS key policies on log destinations, and EventBridge rules that never fire.
Exposed keys and forensic evidence
Scoping the damage of a leaked access key and preserving evidence with S3 Object Lock.