Skip to Content
Asterrr's Handbook
6 · Security foundations and governance

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.

Source account and RegionAggregator accountconfig itemevaluateremediatecomplianceResource changeConfig recorderConfig ruleSSM AutomationAggregator
A change is recorded as a configuration item, evaluated by rules, and the result can start remediation. An aggregator in the security account collects results from many accounts.
1 per Region
Config configuration recorder per account per Region. Security Hub CSPM needs it on.
24 h
Longest periodic trigger interval for a Config rule (options are 1, 3, 6, 12 and 24 hours).

Core facts

ItemWhat to remember
Proactive rulesReport only. They do not block or remediate
RemediationThrough Systems Manager Automation documents. Manual or automatic
Conformance packYAML template bundling rules and remediation. Deploy to an account and Region or across an organization
Organization rulesDeploy rules and conformance packs to all accounts from the management or delegated administrator account
AggregatorCollects configuration and compliance from accounts and Regions, or a whole organization. Read-only, no extra cost
Aggregator authorizationNeeded 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 typeHow you write itPick it when
Managed rulePick from 400+ AWS rules and set parametersA rule exists. Always the least-effort answer
Custom policy ruleGuard DSL, no code to hostYour own logic, expressible as property checks
Custom Lambda ruleYour Lambda function returns the evaluationLogic 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 StartResourceEvaluation API or a Hook. Proactive evaluation reports only; it doesn't block or remediate on its own.
  • Results are COMPLIANT, NON_COMPLIANT, NOT_APPLICABLE or ERROR.
  • 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

NON_COMPLIANTcompliance change eventResource changesConfig ruleRemediationaction SSMAutomationResource fixedEventBridgeSNS, chat orticket
Diagram of remediation
  • A remediation action runs a Systems Manager Automation runbook, either an AWS one (for example AWS-DisableS3BucketPublicReadWrite or AWS-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

StageTool
Before deploy (template)CloudFormation Guard, Guard Hooks, Config proactive rule
Block at APISCP, RCP, declarative policy
Detect driftConfig detective rules, Control Tower detective controls
FixConfig remediation, EventBridge plus Lambda
ReportAggregator, 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_APPLICABLE for 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

Is this resourceconfigured the way ourrule says?Deploy a wholeframework's rules toevery accountScore us against FSBP,CIS, PCI DSS or NIST,with severitiesGive auditors AWS's ownSOC 2 or PCI reportAccept a BAA for HIPAAworkloadsReview a workload'sdesign against bestpracticeWhat does the requirementask?AWS Config rule(+ SSMAutomationConformance pack(organization-wide)Security HubCSPM standardsAWS ArtifactreportsAWS ArtifactagreementsWell-Architected Toolsecurity pillarAggregator for one viewacross accounts andRegions
Decision tree for which service answers which question
ServiceEvaluatesOutputFixes things?
AWS ConfigResource configuration against rulesCompliant or non-compliant per resource, with historyYes, remediation actions
Security Hub CSPMControls grouped into standards (it uses service-linked Config rules)Control findings, security score, severityThrough EventBridge or automation rules
Audit ManagerEvidence mapped to framework controlsAssessment reportsNo
AWS ArtifactNothing in your account: AWS's own complianceThird-party audit reports, agreementsNo
Well-Architected ToolYour answers about a workload's designHigh and medium risk issues, improvement planNo
Trusted AdvisorA fixed set of best-practice checksRed, yellow, green resultsNo

Scenarios

Scenario
An insurance company runs 90 accounts in AWS Organizations. The compliance team must ensure that every EBS volume in every account, including accounts created next year, is encrypted. The team must be notified whenever a volume becomes non-compliant, and wants one dashboard showing compliance across all accounts and Regions. Which combination of steps meets these requirements with the LEAST operational overhead?
Scenario
A Config rule flags S3 buckets that allow public read access. The team configured automatic remediation with the AWS-DisableS3BucketPublicReadWrite runbook, but non-compliant buckets stay non-compliant and the remediation shows as failed. Config recording and the rule itself are working. What is the MOST likely cause?

CloudFormation Guard and Hooks, Central management. Security Hub CSPM and audit evidence, Well-Architected Tool, AWS Config in detection.

Further reading

On this page