Aws Patch & Compliance Report

Table of contents
- π§ Understanding AWS Patch Compliance and Non-Compliance: A Deep Dive
- π οΈ What is Patching?
- β What is Compliance & Non-Compliance?
- β Why is Patch Compliance Needed?
- βοΈ AWS Patch Compliance Workflow
- π Anatomy of a Patch Compliance Report
- π‘ Use Cases & Examples
- π§© Best Practices
- π AWS CLI Commands for Patch Compliance Reports
- π Conclusion

π§ Understanding AWS Patch Compliance and Non-Compliance: A Deep Dive
In todayβs fast-evolving cloud environments, maintaining the security and stability of infrastructure is critical. One key component of this is patching β and in AWS, Systems Manager Patch Manager helps organizations manage patch compliance across their fleets of EC2 instances.
This blog post breaks down what patching is, the concepts of compliance and non-compliance, why it matters, and how AWS implements this with real-world use cases.
π οΈ What is Patching?
Patching refers to the process of applying updates to software (operating systems, applications, and dependencies) to fix vulnerabilities, bugs, or improve performance. These patches are often released by vendors to address:
Security flaws (critical/important)
Software bugs
Performance improvements
Compatibility issues
β What is Compliance & Non-Compliance?
Compliance
An instance is compliant when all required patches (as defined by the patch baseline) are successfully installed.
Non-Compliance
An instance is non-compliant if:
It has missing critical or important patches.
Patch installation failed.
It was not scanned or updated recently.
It deviates from the baseline.
β Why is Patch Compliance Needed?
Security: Unpatched systems are major attack vectors.
Governance: Meet regulatory standards (e.g., HIPAA, PCI-DSS, NIST).
Stability: Prevent crashes, bugs, and performance issues.
Audit Readiness: Prove to auditors that systems are up-to-date.
Operational Efficiency: Automate compliance reporting and remediation.
βοΈ AWS Patch Compliance Workflow
Hereβs how AWS manages patch compliance using Systems Manager Patch Manager:
Step-by-Step Workflow:
Tag EC2 Instances:
- Group instances using tags like
Patch Group = Production
.
- Group instances using tags like
Define Patch Baseline:
- Specifies which patches (OS type, classification, severity) are required.
Configure Patch Group:
- Assign the patch baseline to the instance group.
Scan Phase:
Systems Manager checks which patches are missing (
Scan
mode).Generates compliance data.
Install Phase:
Missing patches are installed (
Install
mode).Instance is rebooted if required.
Compliance Report Generated:
Compliant / Non-Compliant status recorded.
View in Console, CLI, or export to S3/Athena for analysis.
π Anatomy of a Patch Compliance Report
Field | Description |
Instance ID | Unique identifier of EC2 instance |
OS Type | Amazon Linux, Ubuntu, Windows, etc. |
Patch Group | Group/tag for patching |
Patch Baseline ID | Reference to the patch rules |
Compliance Type | Patch |
Status | Compliant , Non-Compliant , or Unknown |
Missing Count | Number of missing patches |
Severity | Critical, Important, Medium, Low |
Operation Time | Last scan or patch time |
π‘ Use Cases & Examples
Use Case 1: Security Hardening for Production
Problem: A critical vulnerability (e.g., Log4Shell) needs to be patched across hundreds of instances.
Solution:
Define patch baseline with critical severity.
Use Patch Manager to scan and apply patches.
Run compliance reports to verify updates.
Example:
aws ssm describe-instance-patch-states --instance-ids i-1234567890abcdef0
Use Case 2: Audit Readiness for Compliance Standards
Problem: You need monthly patch compliance reports for HIPAA audits.
Solution:
Schedule scans/installations via Maintenance Windows.
Export compliance data to Amazon S3, query via Athena.
Share reports with auditors.
Use Case 3: Auto Remediation with EventBridge
Problem: An instance becomes non-compliant unexpectedly.
Solution:
Create EventBridge rule for
NonCompliant
events.Trigger a Systems Manager Automation document to install missing patches.
π§© Best Practices
Tag all EC2 instances consistently with
Patch Group
.Use Maintenance Windows for controlled patching.
Enable logging and reporting to track compliance over time.
Use Patch Baseline Approvals to auto-approve patches after N days.
π AWS CLI Commands for Patch Compliance Reports
π 1. Describe compliance by instance
This command shows compliance status per instance.
aws ssm describe-instance-compliance-status --instance-id i-0123456789abcdef0
π 2. List patch state of an instance
Gives a summary of patching status for a single instance.
aws ssm describe-instance-patch-states --instance-ids i-0123456789abcdef0
π 3. List patch state across all instances
Get compliance status (e.g., Compliant/Non-Compliant) for all managed instances.
aws ssm describe-instance-patch-states
π 4. List missing patches for a specific instance
Detailed report of all missing patches on a given instance.
aws ssm describe-instance-patches --instance-id i-0123456789abcdef0 --filters Key=State,Values=Missing
π 5. List compliance summaries for all resources
Useful to see summary counts across the fleet.
aws ssm list-compliance-summaries
π― 6. Query for all non-compliant instances
Using jq
to filter for non-compliant ones:
aws ssm describe-instance-patch-states | jq '.InstancePatchStates[] | select(.PatchStatus != "COMPLIANT")'
π Conclusion
Patch compliance is a cornerstone of secure and resilient cloud operations. AWS Patch Manager, combined with Systems Manager and EventBridge, offers a powerful toolset to ensure your EC2 instances are up-to-date and compliant β whether you're aiming for operational hygiene or meeting strict audit requirements.
By implementing automated workflows and regular compliance checks, you can stay ahead of threats and remain audit-ready at all times.
#aws #patch #cloud #tech
Subscribe to my newsletter
Read articles from Sivaranjan directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Sivaranjan
Sivaranjan
Cloud & DevOps Engineer | AWS Solutions Architect | Terraform Associate | Love to work with #AWS #Terraform #Docker #Kubernetes #Jenkins #GitHub #Linux