AWS Config rules and resource timeline

CloudTrail tells you who made a change, but it won’t tell you what the security group looked like before, or which of your 400 security groups are breaking the rules right now. AWS Config rules and the Config resource timeline answer those questions for you, all the time and without anyone asking.

You’ll switch on the Config recorder for a few resource types and add two managed rules, then open SSH to the world on a test group and watch Config flag it. After you fix it, you’ll read the group’s full history, and along the way you’ll hit the two setup problems that stop Config from working at all.

TimeYou needBy the end you can
50 minutesLesson 25 done (saat-trail), saat-vpc, your laptop signed in as saat-admin. Cost: a few cents (about USD 0.003 per recorded change and USD 0.001 per rule evaluation). Everything is turned off at the end.Set up the Config recorder and delivery channel, add managed rules, read compliance results and resource timelines, and fix problems with delivery and recording scope.

What it is, in one line

AWS Config records how your resources are configured over time and checks them against rules, marking each one COMPLIANT or NON_COMPLIANT.

In Simple Words

The school uniform inspector

Every morning a teacher walks down the line checking uniforms (tie on, shoes polished, ID card showing) and notes down anyone who breaks a rule, and that teacher is a Config rule. The school also takes a class photo every time something changes, like a new haircut or a new bag, so months later you can flip back and see what anyone looked like on any day, and that photo album is the resource timeline. The teacher only checks the classes they’re told to check, though, so if nobody asks them to look at Class 5, Class 5 never gets inspected.

Engineer's View

How AWS Config really works

Whenever a recorded resource changes, the configuration recorder captures a configuration item (CI) holding its full configuration, its relationships and the IDs of the related CloudTrail events. You can record all supported types or pick a list, and in a busy account recording everything can get expensive. The delivery channel sends the history and snapshots to an S3 bucket, and to SNS if you want.

Rules look at resources and return COMPLIANT, NON_COMPLIANT or NOT_APPLICABLE. AWS managed rules cover the common checks like open SSH, unencrypted volumes and S3 versioning, and for anything else you write custom rules with Lambda or Guard policies.

A rule can be triggered by configuration changes, by a schedule, or by both, but if its resource type isn’t being recorded it will never get any change-triggered results.

Remediation ties a rule to a Systems Manager Automation document that runs manually or automatically. Conformance packs roll out groups of rules in one go, and an aggregator pulls results together from many accounts and Regions. Keep in mind Config is Regional, so you need to record in every Region you use.

How it works, step by step

This is how one bad change gets caught.

1Someone changes a resource

Someone adds 22 from 0.0.0.0/0 to a security group, and CloudTrail records that API call (Lesson 25).

AWS Config rules flow: change, configuration item, rule evaluation, NON_COMPLIANT

2The recorder captures the new state

Within a few minutes Config stores a configuration item with every rule on the group, its VPC, its tags and the CloudTrail event that caused the change.

3Rules evaluate it

restricted-ssh (the managed rule INCOMING_SSH_DISABLED) checks the new CI and marks the group NON_COMPLIANT, and from there you can alert on it with EventBridge or fix it automatically.

4History stays

Config keeps every CI, so the group’s timeline shows each version. Config and CloudTrail answer different questions:

CloudTrail vs AWS Config: API calls, resource timeline, rules and conformance packs

During an incident you’ll often reach for both, Config to see what a resource looked like at 2 a.m. and CloudTrail to see who changed it at 2:05.

✅ Checkpoint: You can explain the recorder, configuration items, the delivery channel and rules, and why the recording scope matters.

Hands-on lab: AWS Config rules that catch an open port

Before you run any command, double-check it

Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.

Sign in and set up the names:

cd C:\aws-lab
aws login --profile saat-admin
$env:AWS_PROFILE = 'saat-admin'
$v = Get-Content C:\aws-lab\saat-vpc.json | ConvertFrom-Json
$acct = aws sts get-caller-identity --query Account --output text
$bucket = "saat-config-$acct-ap-south-1-an"

1Create the Config bucket and service role

Paste this whole block:

aws s3api create-bucket --bucket $bucket --bucket-namespace account-regional --region ap-south-1 --create-bucket-configuration LocationConstraint=ap-south-1 | Out-Null
@'
{
  "Version": "2012-10-17",
  "Statement": [
    { "Sid": "AWSConfigBucketPermissionsCheck", "Effect": "Allow", "Principal": { "Service": "config.amazonaws.com" }, "Action": "s3:GetBucketAcl", "Resource": "arn:aws:s3:::BUCKET", "Condition": { "StringEquals": { "AWS:SourceAccount": "ACCT" } } },
    { "Sid": "AWSConfigBucketExistenceCheck", "Effect": "Allow", "Principal": { "Service": "config.amazonaws.com" }, "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::BUCKET", "Condition": { "StringEquals": { "AWS:SourceAccount": "ACCT" } } },
    { "Sid": "AWSConfigBucketDelivery", "Effect": "Allow", "Principal": { "Service": "config.amazonaws.com" }, "Action": "s3:PutObject", "Resource": "arn:aws:s3:::BUCKET/AWSLogs/ACCT/Config/*", "Condition": { "StringEquals": { "s3:x-amz-acl": "bucket-owner-full-control", "AWS:SourceAccount": "ACCT" } } }
  ]
}
'@ -replace 'BUCKET', $bucket -replace 'ACCT', $acct | Set-Content config-bucket-policy.json
aws s3api put-bucket-policy --bucket $bucket --policy file://config-bucket-policy.json
aws iam create-service-linked-role --aws-service-name config.amazonaws.com 2>$null | Out-Null
aws iam get-role --role-name AWSServiceRoleForConfig --query Role.Arn --output text

You should see something like this:

arn:aws:iam::111122223333:role/aws-service-role/config.amazonaws.com/AWSServiceRoleForConfig

The service-linked role is what lets Config read your resources. If you already have it, the create command fails quietly and the get shows it anyway.

2Start recording two resource types

Paste this whole block:

@'
{
  "allSupported": false,
  "includeGlobalResourceTypes": false,
  "recordingStrategy": { "useOnly": "INCLUSION_BY_RESOURCE_TYPES" },
  "resourceTypes": [ "AWS::EC2::SecurityGroup", "AWS::S3::Bucket" ]
}
'@ | Set-Content recording-group.json
aws configservice put-configuration-recorder --configuration-recorder "name=default,roleARN=arn:aws:iam::$($acct):role/aws-service-role/config.amazonaws.com/AWSServiceRoleForConfig" --recording-group file://recording-group.json
aws configservice put-delivery-channel --delivery-channel "name=default,s3BucketName=$bucket"
aws configservice start-configuration-recorder --configuration-recorder-name default
Start-Sleep 60
aws configservice describe-configuration-recorder-status --query "ConfigurationRecordersStatus[0].[recording,lastStatus]" --output text

You should see this:

True    SUCCESS

Recording only security groups and S3 buckets keeps the lab down to a few cents. A real account normally records all supported types and leaves out noisy ones only when there’s a reason.

3Add two rules and break one on purpose

Paste the whole block. The evaluations take a few minutes:

'{ "ConfigRuleName": "restricted-ssh", "Source": { "Owner": "AWS", "SourceIdentifier": "INCOMING_SSH_DISABLED" }, "Scope": { "ComplianceResourceTypes": [ "AWS::EC2::SecurityGroup" ] } }' | Set-Content rule-ssh.json
'{ "ConfigRuleName": "s3-versioning", "Source": { "Owner": "AWS", "SourceIdentifier": "S3_BUCKET_VERSIONING_ENABLED" }, "Scope": { "ComplianceResourceTypes": [ "AWS::S3::Bucket" ] } }' | Set-Content rule-s3.json
aws configservice put-config-rule --config-rule file://rule-ssh.json
aws configservice put-config-rule --config-rule file://rule-s3.json
$sg = aws ec2 create-security-group --group-name lab26-ssh --description "Config rule test" --vpc-id $v.VpcId --query GroupId --output text
aws ec2 authorize-security-group-ingress --group-id $sg --protocol tcp --port 22 --cidr 0.0.0.0/0 | Out-Null
do { Start-Sleep 30; $r = aws configservice get-compliance-details-by-resource --resource-type AWS::EC2::SecurityGroup --resource-id $sg --query "EvaluationResults[0].ComplianceType" --output text } until ($r -eq 'NON_COMPLIANT')
aws configservice describe-compliance-by-config-rule --query "ComplianceByConfigRules[].[ConfigRuleName,Compliance.ComplianceType]" --output text

You should see something like this:

restricted-ssh  NON_COMPLIANT
s3-versioning   NON_COMPLIANT

restricted-ssh caught lab26-ssh, and s3-versioning flags your trail and Config buckets because they don’t have versioning on. That’s a real finding, since a lot of companies require versioning on log buckets. Here you’ll leave them alone to avoid extra storage cost and note the decision down, because accepting an exception is still a decision.

AWS Config rules lab output: non-compliant rules, security group timeline, compliant after fix
Rule results, the security group timeline and the fix. It should look something like this.

4Fix it and read the timeline

Paste this whole block:

aws ec2 revoke-security-group-ingress --group-id $sg --protocol tcp --port 22 --cidr 0.0.0.0/0 | Out-Null
do { Start-Sleep 30; $r = aws configservice get-compliance-details-by-resource --resource-type AWS::EC2::SecurityGroup --resource-id $sg --query "EvaluationResults[0].ComplianceType" --output text } until ($r -eq 'COMPLIANT')
aws configservice get-resource-config-history --resource-type AWS::EC2::SecurityGroup --resource-id $sg --query "configurationItems[].[configurationItemCaptureTime,configurationItemStatus,length(relatedEvents)]" --output text
$r

You should see something like this:

2026-10-20T19:31:44.120000+05:30      OK      1
2026-10-20T19:24:02.877000+05:30      ResourceDiscovered      2
COMPLIANT

You now have two versions of the group, each with the CloudTrail event IDs behind it. In the console, open Config, go to Resources, pick lab26-ssh and choose Resource timeline, and you’ll see the rule appear and then go away.

AWS Config resource timeline for security group lab26-ssh showing noncompliant then compliant
This is Config’s resource timeline for lab26-ssh, with one version where SSH is open to the world and one after the fix, each tied to its own CloudTrail event.

✅ Checkpoint: The recorder is running with status SUCCESS, restricted-ssh flagged lab26-ssh and then marked it COMPLIANT after the fix, and the timeline shows both versions. Keep it all for the break lab.

Break It, Then Fix It

These are the two problems that make people decide “Config doesn’t work”.

1Break it: a delivery channel the bucket won’t accept

Take the bucket policy off and then update the delivery channel, the way a pipeline that rebuilds settings would:

aws s3api delete-bucket-policy --bucket $bucket
aws configservice put-delivery-channel --delivery-channel "name=default,s3BucketName=$bucket"

You’ll get an error like this:

An error occurred (InsufficientDeliveryPolicyException) when calling the PutDeliveryChannel operation: Insufficient delivery policy to s3 bucket: saat-config-111122223333-ap-south-1-an, unable to write to bucket, provided s3 key prefix is 'null', provided kms key is 'null'.

Config checks that it can read the bucket ACL, list the bucket and write under AWSLogs/ACCOUNT/Config/. The service-linked role has no S3 permissions of its own, so the bucket policy has to grant them. Fix: put the policy back and try again:

aws s3api put-bucket-policy --bucket $bucket --policy file://config-bucket-policy.json
aws configservice put-delivery-channel --delivery-channel "name=default,s3BucketName=$bucket"
aws configservice describe-delivery-channel-status --query "DeliveryChannelsStatus[0].configHistoryDeliveryInfo.lastStatus" --output text

You should see this:

SUCCESS

2Break it: a rule for a type you don’t record

Add a rule that checks subnets and come back to it after a few minutes:

'{ "ConfigRuleName": "subnet-no-public-ip", "Source": { "Owner": "AWS", "SourceIdentifier": "SUBNET_AUTO_ASSIGN_PUBLIC_IP_DISABLED" }, "Scope": { "ComplianceResourceTypes": [ "AWS::EC2::Subnet" ] } }' | Set-Content rule-subnet.json
aws configservice put-config-rule --config-rule file://rule-subnet.json
Start-Sleep 180
aws configservice describe-compliance-by-config-rule --config-rule-names subnet-no-public-ip --query "ComplianceByConfigRules[0].Compliance.ComplianceType" --output text

You should see this:

INSUFFICIENT_DATA
AWS Config problems: InsufficientDeliveryPolicyException and INSUFFICIENT_DATA rule
Both problems and their fixes. Something like this.

There’s nothing wrong with the rule. The recorder never records subnets, so the rule has nothing to judge, and in a real account this shows up as a dashboard of green and grey where nobody notices the grey. Fix: add the type to the recording group:

(Get-Content recording-group.json -Raw) -replace '"AWS::S3::Bucket"', '"AWS::S3::Bucket", "AWS::EC2::Subnet"' | Set-Content recording-group.json
aws configservice put-configuration-recorder --configuration-recorder "name=default,roleARN=arn:aws:iam::$($acct):role/aws-service-role/config.amazonaws.com/AWSServiceRoleForConfig" --recording-group file://recording-group.json
do { Start-Sleep 30; $r = aws configservice describe-compliance-by-config-rule --config-rule-names subnet-no-public-ip --query "ComplianceByConfigRules[0].Compliance.ComplianceType" --output text } until ($r -ne 'INSUFFICIENT_DATA')
aws configservice get-compliance-details-by-config-rule --config-rule-name subnet-no-public-ip --compliance-types NON_COMPLIANT --query "length(EvaluationResults)"

You should see this:

2

saat-public-a and saat-public-b auto-assign public IPs, which is the whole point of a public subnet. A good rule program deals with that through an exception (say, by tag) and doesn’t delete the rule.

Now switch Config off and clean up so it stops recording and charging you:

aws configservice delete-config-rule --config-rule-name restricted-ssh
aws configservice delete-config-rule --config-rule-name s3-versioning
aws configservice delete-config-rule --config-rule-name subnet-no-public-ip
aws configservice stop-configuration-recorder --configuration-recorder-name default
aws configservice delete-delivery-channel --delivery-channel-name default
aws configservice delete-configuration-recorder --configuration-recorder-name default
aws ec2 delete-security-group --group-id $sg
aws s3 rm "s3://$bucket" --recursive | Out-Null
aws s3 rb "s3://$bucket"
Remove-Item config-bucket-policy.json, recording-group.json, rule-*.json
.\Find-LabResources.ps1

✅ Checkpoint: You fixed InsufficientDeliveryPolicyException and a rule stuck in INSUFFICIENT_DATA because of recording scope. Config is fully off and its bucket is deleted, while saat-trail keeps running.

This happened at work

The audit that found nothing, wrongly

A healthcare company was getting ready for an audit and had a Config conformance pack checking encryption on databases, volumes and buckets. The dashboard showed no non-compliant RDS instances, so the team told the auditors every database was encrypted. Then the auditor asked to see the evaluation for one database, and there wasn’t one. It turned out that months earlier someone had cut the recorder down to “the important types” to save money, RDS wasn’t on that list, and every RDS rule had been sitting in INSUFFICIENT_DATA ever since, while two old databases were in fact unencrypted. Now the team records all supported types (leaving out a few noisy ones by documented decision), gets an alert when any rule stays in INSUFFICIENT_DATA for more than a day, and uses a Config aggregator so security sees every account and Region in one view.

Common mistakes and troubleshooting

MistakeWhat happensWhat to do
Rule for a type the recorder skipsINSUFFICIENT_DATA foreverRecord the type, or record all supported types
Delivery bucket without the Config policyInsufficientDeliveryPolicyExceptionGrant GetBucketAcl, ListBucket and PutObject to config.amazonaws.com
Recording only one RegionResources elsewhere are never checkedEnable Config in every Region you use
Treating “no NON_COMPLIANT” as “compliant”Grey results are missedWatch for INSUFFICIENT_DATA too
Deleting rules that flag expected casesReal problems later go unnoticedUse exceptions by tag or scope
Recording everything in a high-churn account without a checkUnexpected configuration item chargesReview CI counts; consider periodic recording for noisy types

Interview questions

Click a question to open it. Each one is phrased the way an interviewer would ask it, and under it you’ll find why they ask it and one way you could answer in your own words.

Fresher level

1. Can you explain in simple words what AWS Config does?

Why they ask this: They want to know you understand how AWS tracks whether resources follow the rules, and that you see governance as more than a one-time setup.

How you might answer: AWS Config records how your resources are set up over time and checks that against rules, so you can see what’s compliant and what isn’t. Because it keeps the full change history, I can open any resource and see what it looked like last week and what’s changed since then.

2. People often mix up AWS Config and CloudTrail. How would you explain the difference to a new team member?

Why they ask this: They want to see you know which service answers which question, because picking the right one saves a lot of time in an investigation.

How you might answer: I’d say CloudTrail records the API calls, so it tells you who did what and when, and Config records the state of the resource, so it tells you what the resource looked like and whether it follows our rules. In practice I use them together: Config shows me a security group changed, and CloudTrail shows me who changed it.

3. What is a managed rule in AWS Config, and can you give me an example?

Why they ask this: They’re checking you know common checks don’t need any code, which means you can get value out of Config quickly.

How you might answer: It’s a ready-made rule from AWS, so I turn it on and set the parameters. INCOMING_SSH_DISABLED, for example, checks that security groups don’t allow SSH from anywhere, and S3_BUCKET_VERSIONING_ENABLED checks that buckets have versioning switched on.

2–5 years experience

4. You open the Config console and one of your rules shows INSUFFICIENT_DATA. What would you check?

Why they ask this: This status confuses a lot of people, so they want to hear a clear troubleshooting order and see that you can explain it.

How you might answer: I’d first make sure the recorder is recording that resource type and that there are resources of that type in the rule’s scope. If it’s a periodic rule, it might not have run yet. If all that looks fine I’d check the recorder itself, because a stopped recorder or failed delivery also leaves the rule without data.

5. Your team keeps finding non-compliant resources and fixing them by hand. How would you automate that?

Why they ask this: They want to see you can move from reporting problems to fixing them safely, and that you’d test before any automation touches real resources.

How you might answer: I’d attach a remediation action to the Config rule, using a Systems Manager Automation document with an assume role that has only the permissions it needs, and set it to automatic with retry limits. I’d test it on non-production accounts before turning it on everywhere, because an automatic fix that’s wrong can break things.

6. Security asks you for one view of Config compliance across all your accounts and Regions. How would you give them that?

Why they ask this: They want to know you can work beyond a single account, since most real companies run many accounts and nobody wants to check them one at a time.

How you might answer: I’d set up a Config aggregator in a central or delegated admin account. It pulls in results from every account and Region in the organization, so security gets the whole picture in one place.

Senior level

7. You’re asked to build a compliance program for 50 AWS accounts using Config. How would you design it?

Why they ask this: They’re looking for governance thinking at scale, covering standards, ownership, automation and exceptions, and whether you’d design something people can live with and not only something that reports red.

How you might answer: I’d turn on the recorder across the organization through a delegated admin account and deploy conformance packs mapped to our company standard. An aggregator in the security account gives one view, and EventBridge sends alerts to whoever owns the resource. I’d use auto-remediation for the safe fixes, document exceptions with tags, and report on INSUFFICIENT_DATA and drift so gaps in coverage don’t stay hidden.

8. The finance team tells you the AWS Config bill jumped this month. How would you find out why?

Why they ask this: Config costs can creep up quietly, so they want to see you can trace a cost problem back to its source and you know what drives it.

How you might answer: I’d look at configuration items recorded per resource type in Cost Explorer or the usage reports, and usually one high-churn type stands out, often from autoscaling or containers. For those I’d think about periodic recording or leaving them out, and I’d also look at how many rule evaluations run and how big our conformance packs are.

Quick quiz

Q1. What does the Config recorder capture?

  1. API calls
  2. Configuration items for recorded resource types
  3. Application logs
  4. Network packets
Show answer

B — Each change creates a configuration item.

Q2. Why was subnet-no-public-ip INSUFFICIENT_DATA?

  1. No subnets existed
  2. Subnets were not recorded
  3. The rule was wrong
  4. The bucket was full
Show answer

B — A change-triggered rule needs its type recorded.

Q3. What fixed InsufficientDeliveryPolicyException?

  1. A new role
  2. A bucket policy for config.amazonaws.com
  3. Versioning
  4. A KMS key
Show answer

B — Config must be able to check and write to the bucket.

Q4. Which service tells you who changed a resource?

  1. AWS Config
  2. CloudTrail
  3. S3
  4. EFS
Show answer

B — Config links to related CloudTrail events, but CloudTrail records the caller.

Q5. What should you do about a rule that flags expected cases?

  1. Delete the rule
  2. Add a documented exception
  3. Stop the recorder
  4. Ignore all results
Show answer

B — Exceptions keep the rule useful for real problems.

Quick recap

  • Config records resource states as configuration items and keeps a timeline of them.
  • Rules mark each resource COMPLIANT or NON_COMPLIANT.
  • The delivery bucket needs a policy for config.amazonaws.com.
  • A rule only works for resource types the recorder is recording.
  • Keep as close an eye on INSUFFICIENT_DATA as on NON_COMPLIANT.

Next lesson

Lesson 27: Patch Manager for Linux and Windows → Next you’ll scan and patch servers with Patch Manager, work with patch baselines and maintenance windows, and read the compliance reports.

Further reading: AWS Config rules

Want to go deeper into AWS Config rules? Read What is AWS Config? and List of AWS Config managed rules. You can also see the full plan for this course on the AWS Cloud Administration course page.

Scroll to Top

This website uses cookies

We use a few cookies to keep this site working. If you allow it, we also use Google Analytics to count visits so we can improve our lessons. You can accept all, deny the optional ones, or choose what to allow.