AWS Config rules and compliance evaluation
Config rules, evaluation modes, conformance packs, remediation and multi-account aggregators.
Exam tasks: 6.3 (skill 6.3.1 detect, remediate and notify on non-compliant resources)
The decision: is the question about your resources' configuration (Config rules, conformance packs, Security Hub CSPM), proof for an auditor (Audit Manager, Artifact), or the design itself (Well-Architected Tool)?
AWS Config records resource configuration and evaluates it against rules. It detects and reports noncompliance. It never blocks a deployment itself. A Config aggregator gives a read-only multi-account, multi-Region view.
Core facts
| Item | What to remember |
|---|---|
| Proactive rules | Report only. They do not block or remediate |
| Remediation | Through Systems Manager Automation documents. Manual or automatic |
| Conformance pack | YAML template bundling rules and remediation. Deploy to an account and Region or across an organization |
| Organization rules | Deploy rules and conformance packs to all accounts from the management or delegated administrator account |
| Aggregator | Collects configuration and compliance from accounts and Regions, or a whole organization. Read-only, no extra cost |
| Aggregator authorization | Needed for individual source accounts. Not needed when the source is an Organizations organization |
Exam signal
"Automatically fix an unencrypted volume or public bucket when flagged": Config rule with auto remediation (SSM Automation). "Block before creation": CloudFormation Guard Hook or an SCP, not Config.
Rules, triggers and evaluation modes
Config records the configuration of supported resources (the configuration recorder, one per account per Region) and delivers history and snapshots to S3 through a delivery channel. Rules evaluate those records.
| Rule type | How you write it | Pick it when |
|---|---|---|
| Managed rule | Pick from 400+ AWS rules and set parameters | A rule exists. Always the least-effort answer |
| Custom policy rule | Guard DSL, no code to host | Your own logic, expressible as property checks |
| Custom Lambda rule | Your Lambda function returns the evaluation | Logic needs API calls or data Config doesn't record |
- Triggers: configuration change (scoped by resource type, ID or tag), periodic (1, 3, 6, 12 or 24 hours), or both.
- Evaluation modes: detective evaluates resources that exist. Proactive evaluates a proposed resource
configuration before deployment, through the
StartResourceEvaluationAPI or a Hook. Proactive evaluation reports only; it doesn't block or remediate on its own. - Results are
COMPLIANT,NON_COMPLIANT,NOT_APPLICABLEorERROR. - Organization rules deploy a rule to every account from the management account or a Config delegated admin.
Exam signal
If a managed rule matches the requirement (s3-bucket-public-read-prohibited, encrypted-volumes,
restricted-ssh, iam-root-access-key-check, required-tags), it beats any custom Lambda. The exam rewards "least
operational overhead".
Remediation
- A remediation action runs a Systems Manager Automation runbook, either an AWS one (for example
AWS-DisableS3BucketPublicReadWriteorAWS-EnableS3BucketEncryption) or your own. - Manual remediation waits for someone to click. Automatic remediation runs when the rule reports non-compliance, with a configurable number of retries.
- The runbook needs an automation assume role with permission to make the fix. A missing or under-privileged role is the usual reason remediation "doesn't work".
- For notifications, send Config compliance change events through EventBridge to SNS. Config's own SNS topic on the delivery channel sends every configuration change, which is usually too noisy.
Remediation that fights IaC
If CloudFormation owns the resource, automatic remediation changes it outside the stack and causes drift. The next deployment may put the bad setting back. Fix the template, and use remediation as the safety net.
Conformance packs and aggregators
- A conformance pack is a YAML template of Config rules and optional remediation actions, deployed and reported as one unit. AWS provides sample packs such as Operational Best Practices for PCI DSS 4.0, HIPAA Security, NIST 800-53 and CIS.
- Deploy organization conformance packs from the management account or Config delegated admin to put the same pack in every account. Each pack gets a compliance score.
- An aggregator collects Config data and rule results from many accounts and Regions into one account. Use an organization aggregator so new accounts are included automatically. It's read-only: it doesn't deploy rules or remediate.
- Run advanced queries (SQL) on the aggregator for questions like "every unencrypted EBS volume in the org".
The aggregator enforces nothing
An aggregator only shows results for rules that already exist in each source account. "Evaluate every account" needs organization rules or conformance packs first, then an aggregator to view them.
Prevent, detect, fix
| Stage | Tool |
|---|---|
| Before deploy (template) | CloudFormation Guard, Guard Hooks, Config proactive rule |
| Block at API | SCP, RCP, declarative policy |
| Detect drift | Config detective rules, Control Tower detective controls |
| Fix | Config remediation, EventBridge plus Lambda |
| Report | Aggregator, conformance pack compliance, Security Hub |
Cost notes
- Scope custom Lambda rules to resource types. With none selected, the function is invoked for every resource.
- Return
NOT_APPLICABLEfor deleted resources in custom Lambda rules so results are cleaned up. - Control Tower accounts need existing Config recorders removed before enrollment. See Control Tower.
Which one to use
| Service | Evaluates | Output | Fixes things? |
|---|---|---|---|
| AWS Config | Resource configuration against rules | Compliant or non-compliant per resource, with history | Yes, remediation actions |
| Security Hub CSPM | Controls grouped into standards (it uses service-linked Config rules) | Control findings, security score, severity | Through EventBridge or automation rules |
| Audit Manager | Evidence mapped to framework controls | Assessment reports | No |
| AWS Artifact | Nothing in your account: AWS's own compliance | Third-party audit reports, agreements | No |
| Well-Architected Tool | Your answers about a workload's design | High and medium risk issues, improvement plan | No |
| Trusted Advisor | A fixed set of best-practice checks | Red, yellow, green results | No |
Scenarios
An organization conformance pack puts the managed rule in every current and future account, the organization aggregator gives the single view, and EventBridge handles notification. A per-account Lambda is the high-effort option and misses new accounts until someone deploys it. Trusted Advisor's fixed checks can't be customized to this rule or wired to org-wide notifications. An aggregator only displays results; it doesn't deploy or evaluate rules.
Remediation runs the runbook with the automation assume role you supply, and if that role can't call the S3 actions the runbook needs, every attempt fails. The trigger type changes when evaluation happens, not whether remediation succeeds. Remediation works with managed rules, and bucket encryption has nothing to do with public access settings.
Related
CloudFormation Guard and Hooks, Central management. Security Hub CSPM and audit evidence, Well-Architected Tool, AWS Config in detection.
Further reading
Service Catalog, RAM and Firewall Manager
Sharing approved resources with Service Catalog and AWS RAM, and pushing central network policy with Firewall Manager.
Security Hub CSPM, audit evidence and shared responsibility
Continuous standards scoring with Security Hub CSPM, audit evidence with Audit Manager and AWS Artifact, and where the shared responsibility line sits.