Investigating AWS CloudTrail

How CloudTrail records API activity, what event history, trails and data events do and do not keep, reading userIdentity and access key types, the event names that mark an intrusion, and querying with Athena and CloudTrail Lake to rebuild what a leaked key did.

● Must know for interviews🔒 PROBy ·Lesson·11 min read·Advanced → Staff
AWS CloudTrailcloud forensicsIAMAthenaaccess keyscloud incident response

01What CloudTrail records, and what it does not

✓What you will learn
  • Know what event history, trails and data events keep, and for how long
  • Read a CloudTrail record: userIdentity, access key type, source IP and errors
  • Recognise the event names that mark credential abuse, persistence and defence evasion
  • Rebuild what a leaked key did with Athena or CloudTrail Lake

AWS CloudTrail records API calls made in an account: by the console, the CLI, SDKs and AWS services acting for you. Every action in AWS is an API call, so CloudTrail is the closest thing to a complete audit trail the cloud offers, provided it was configured before the incident.

FeatureWhat it keepsGotcha
Event history90 days of management events, per region, free and always onSearchable in the console with limited filters; no data events; regional
TrailManagement events (and optionally data events) delivered to S3, and optionally CloudWatch LogsMust be created; multi-region and organisation trails are what you want
Data eventsObject-level and data-plane calls: S3 GetObject and PutObject, Lambda Invoke, DynamoDB itemsOff by default and billed per event; without them you cannot say which S3 objects were read
CloudTrail LakeEvents stored in an event data store queryable with SQLRetention set per data store; extra cost
InsightsUnusual API call rates or error ratesMust be enabled per trail
!No data events, no proof of exfiltration

The most common gap in cloud cases: an attacker listed and downloaded an S3 bucket, and the account had only management events. You will see ListBuckets and maybe GetBucketPolicy, but not one GetObject. S3 server access logs, if enabled, are the fallback. Check what was logged before you promise anyone an answer about data.

This is an advanced module

Cloud & identity incident response is part of the Pro pass. 4 more sections — the deep dives, the final design, follow-ups and the test — unlock with it.

Already a cyart.io or studio.cyart.io member? Your pass code is in your Studio account.