CloudTrail and AWS Config
Who did what, and what did it look like: CloudTrail events, event history and trails, log integrity, AWS Config recording, rules and remediation.
Assuming roles with STSOrganizations, SCPs and multi-account setupsCloudWatch Logs and Logs Insights
CloudTrail and AWS Config
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- CloudTrail records API activity: who called what, when, from where and with which result. AWS Config records how resources were configured over time.
- Event history keeps 90 days of management events per Region for free. Anything longer or broader needs a trail.
- Data events, such as reading S3 objects or invoking functions, are off by default and are charged.
- Send an organization trail to a bucket in a separate account, with log file validation on, so a compromised account cannot rewrite its history.
- Config rules flag noncompliant resources and can trigger remediation. Recording and evaluations are billed, so scope them.
- CloudTrail Lake stopped accepting new customers on 31 May 2026.
Two questions after every incident
“Who changed this?” and “What was it like before?” Memory and chat history answer neither reliably. Every change on AWS goes through an API, so the platform can keep the record for you.
CloudTrail is the visitor log: who came, what they did. AWS Config is the series of photographs: how each room looked before and after.
CloudTrail
An event records the identity, action, time, source address, parameters and any error. A trimmed shape:
{"eventTime": "2026-11-29T09:12:44Z",
"eventSource": "ec2.amazonaws.com",
"eventName": "AuthorizeSecurityGroupIngress",
"userIdentity": {"type": "AssumedRole",
"arn": "arn:aws:sts::111122223333:assumed-role/ops/priya"},
"sourceIPAddress": "203.0.113.10",
"requestParameters": {"groupId": "sg-0abc..."}}
This one is illustrative, written by hand. Note the assumed role: the last segment is the session name, which is how you find the person behind a role.
Kinds of event:
- Management events change or inspect resources (create, delete, attach policy, console sign-in). Logged by default.
- Data events are operations on what’s inside: S3 object reads and writes, Lambda invocations. High volume, off by default, charged.
- Insights events flag unusual rates of activity. Optional.
Event history gives every account the last 90 days of management events, per Region, at no charge, searchable on one attribute at a time. It isn’t an archive.
A trail delivers events to S3, and optionally to CloudWatch Logs and EventBridge. Delivery averages about 5 minutes and isn’t guaranteed, so treat it as an audit record, not a real-time tripwire. One copy of management events through a trail has no CloudTrail charge; storage does.
Make the record trustworthy
An attacker who gains admin will try to stop logging or delete it.
- Use an organization trail covering all Regions and all accounts. Members can see it but not change or delete it.
- Deliver to a bucket in a separate log account with tight access, and consider S3 Object Lock.
- Turn on log file validation: CloudTrail writes signed hourly digests, so edits and deletions can be detected.
- Deny
cloudtrail:StopLoggingwith a service control policy, and alert on attempts.
To search, query the S3 files with Athena, or send events to CloudWatch Logs. CloudTrail Lake appears in older material; it closed to new customers on 31 May 2026.
AWS Config
Config’s configuration recorder stores a configuration item each time a resource in scope changes, building a timeline with relationships (this instance used that security group). It works per Region and you pay for what is recorded, so busy, short-lived resources can make it costly. Choose resource types and recording frequency deliberately.
Rules judge resources as compliant or not: AWS-managed ones (unencrypted volumes, open SSH, public buckets) or your own. They run on change or periodically, and some support proactive evaluation before a resource is created. A noncompliant result can start Systems Manager automation to remediate. Conformance packs bundle rules, and an aggregator gives one view across accounts and Regions.
Detection isn’t prevention. Use SCPs and service settings to stop what must never happen, and Config to find what slipped through.
Reacting, not only reading
Waiting for someone to search the logs is too slow for some changes. API calls recorded by CloudTrail can reach EventBridge, where a rule matches on fields such as eventName. Good candidates are short and alarming: root user sign-in, a trail being stopped or deleted, a security group opened to the world, a new access key on a privileged user. Each alert should name an owner and a next step.
Use Athena when the question spans months: partition the trail’s S3 data by date and Region so a query reads only what it needs. Practise the query before an incident, when nobody is in a hurry.
About the video
The embed is Tiny Technical Tutorials’ “AWS CloudTrail Basics”, March 2025, 10 minutes. Its chapters cover what CloudTrail is for, event history, creating a trail, the event types, and viewing output in S3 and CloudWatch, then cleanup. It covers CloudTrail only; an older AWS Config tutorial is in deeper. I judged both from chapters and description, since transcripts couldn’t be fetched. English was judged from the “English (US) original” audio track for the embed.
What was run: nothing. The emulator doesn’t record CloudTrail events, and the sample event is hand written. Everything else is from the AWS docs, checked 2026-11-29. One dated item there: from 21 December 2026, trails already logging S3 data events will also receive two new S3 event types, billed unless excluded.
Where this fits
You can now see what happened. Next, keeping the credentials your applications use out of harm’s way: Secrets Manager and Parameter Store.
Check yourself
A security group was opened to the internet last month. Which service tells you what changed, and which tells you who did it?
AWS Config shows the security group's configuration timeline, before and after. CloudTrail shows the AuthorizeSecurityGroupIngress call with the identity, time and source address. Config can link the two.
You need to know who downloaded a particular object from S3 last week. Event history shows nothing. Why?
Object reads are data events, which are not in event history and are not logged by trails unless you enable them. Without that, or S3 access logs, there may be no record.
The events show an assumed role, not a person. How do you get back to the human?
Look at the session information in the event, such as the role session name and source identity, and find the AssumeRole event that created the session. Require meaningful session names or source identity when people assume roles.
Does a Config rule that flags public buckets stop anyone creating one?
A detective rule only reports after the change. To prevent it, use guardrails such as Block Public Access and service control policies, or proactive evaluation before deployment.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.