Evaluating Compliance with AWS Config Rules and Remediation
This lesson explains how AWS Config records what resources look like over time, evaluates whether they comply with your rules, and remediates automatically, with organisation-wide views.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the configuration recorder and delivery channel.
- Distinguish managed rules, custom Lambda rules, custom policy rules and conformance packs.
- Explain how automatic remediation and notifications attach to rules.
Recording configuration
The configuration recorder captures configuration items and relationships for all or selected resource types. The delivery channel sends history and snapshots to S3 and change notifications to SNS. You can see what a security group looked like at any time and, with CloudTrail, who changed it.
Recording configuration
Rules and packs
AWS Config evaluates resource configurations with rules. Managed rules are hundreds of prebuilt checks, such as s3-bucket-public-read-prohibited, restricted-ssh, encrypted-volumes and iam-root-access-key-check, configured with parameters. When no managed rule fits, custom Lambda rules implement your own logic in code, and custom policy rules express it in CloudFormation Guard without writing a function.
Conformance packs bundle rules and their remediation actions into one package, such as packs for CIS, PCI DSS or HIPAA, and can be deployed across the organisation. Aggregators combine configuration and compliance data from many accounts and Regions into one view. The following table summarises these items.
| Item | Description |
|---|---|
| Managed rules | Hundreds of prebuilt checks: s3-bucket-public-read-prohibited, restricted-ssh, encrypted-volumes, iam-root-access-key-check |
| Custom Lambda rules | Your own logic |
| Custom policy rules | Written in CloudFormation Guard |
| Conformance packs | Rules plus remediation as one package (e.g. CIS, PCI DSS, HIPAA), deployable organisation-wide |
| Aggregators | Configuration and compliance from many accounts and Regions in one view |
Rules trigger on configuration changes or run periodically.
Config building blocks
Remediation and notification
Detecting a non-compliant resource is only half the work; it must also be fixed, and the right people must be told. AWS Config attaches remediation actions to rules, which can be run manually by an operator or automatically when a resource becomes non-compliant. Compliance changes are also published as events, so they can notify teams or feed other tools. The following list describes the relevant mechanisms.
- SSM Automation documents, run manually or automatically with retries, e.g. enable Block Public Access or remove an open rule; the remediation role needs permissions.
- EventBridge rules on Config Rules Compliance Change notify via SNS or chat.
- Security Hub shows Config-based control results.
The following diagram follows a violation to its automatic fix.

Fixing and notifying
Automatically blocking public buckets
Policy says no bucket may allow public access, and any violation must be fixed within minutes. The managed rule detects violations, and automatic remediation runs an AWS-provided runbook:
aws configservice put-config-rule --config-rule '{
"ConfigRuleName": "s3-bucket-level-public-access-prohibited",
"Source": { "Owner": "AWS", "SourceIdentifier": "S3_BUCKET_LEVEL_PUBLIC_ACCESS_PROHIBITED" }
}'
aws configservice put-remediation-configurations --remediation-configurations '[{
"ConfigRuleName": "s3-bucket-level-public-access-prohibited",
"TargetType": "SSM_DOCUMENT",
"TargetId": "AWSConfigRemediation-ConfigureS3BucketPublicAccessBlock",
"Automatic": true, "MaximumAutomaticAttempts": 3, "RetryAttemptSeconds": 60,
"Parameters": {
"BucketName": { "ResourceValue": { "Value": "RESOURCE_ID" } },
"AutomationAssumeRole": { "StaticValue": { "Values": ["arn:aws:iam::111111111111:role/ConfigRemediation"] } }
}
}]'Deployed in a conformance pack from the delegated administrator, the rule and its remediation apply to every account. The aggregator shows compliance across the organisation, and the Config timeline records each violation and fix as audit evidence.
How can compliance be seen across all accounts and Regions?
Show answer
With an AWS Config aggregator.
Exam Tips
Remember for the exam
- To remediate public S3 buckets automatically, use a Config rule with automatic SSM Automation remediation.
- For a compliance view across all accounts and Regions, use a Config aggregator.
- To deploy a CIS rule set everywhere, use an organisation conformance pack.
- To see what a resource looked like last month, use Config configuration history.
- To notify when a resource becomes non-compliant, use an EventBridge rule on compliance changes.