AWS CloudTrail
API activity logging, event types, event history, Lake, central multi-account trails and log file integrity validation.
The decision: which CloudTrail feature gives you the evidence you need (event type, where to read it, how to centralize it) and how do you prove the logs were not altered?
CloudTrail records API and console activity as events. It answers who did what, from where, and when. It does not look inside your workloads and does not alert on its own.
Event types
| Type | What it covers | Default |
|---|---|---|
| Management events | Control plane calls such as RunInstances, IAM changes, console sign-in | Logged by default |
| Data events | Data plane calls such as S3 object-level API and Lambda invocations | Off, extra charge |
| Network activity events | API calls made through your VPC endpoints | Off, extra charge |
| Insights events | Unusual API call volume or error rates compared with a baseline | Off, extra charge |
Where to read events
| Option | Retention and scope | Use it for |
|---|---|---|
| Event history | Last 90 days of management events, one Region at a time, no setup | Quick lookup, filter read-only or write-only events |
| Trail to S3 | Whatever the bucket retains. Typically delivered within about 5 minutes of the call | Long-term archive, Athena queries |
| Trail to CloudWatch Logs | Metric filters, alarms, Logs Insights | Near real-time alerting |
| CloudTrail Lake event data store | Immutable, SQL queries. Up to 3,653 days with one-year extendable pricing or 2,557 days with seven-year pricing | Investigations across accounts and Regions without ETL |
Legacy
CloudTrail Lake stopped accepting new customers on May 31, 2026. Existing customers keep using it. For new setups the exam answer is still a trail to S3 queried with Athena.
Central logging
| Goal | How |
|---|---|
| All Regions in one account | Multi-Region trail. Use aws cloudtrail update-trail --name <t> --is-multi-region-trail to convert a single-Region trail. You manage it from its home Region only |
| All accounts in one bucket | Organization trail from the management account or a delegated administrator. A copy of the trail appears in each member account |
| Accounts outside an organization | Edit the central bucket policy. Allow cloudtrail.amazonaws.com s3:GetBucketAcl on the bucket and s3:PutObject on each AWSLogs/<account-id>/* prefix with condition s3:x-amz-acl = bucket-owner-full-control. Then point each account's trail at that bucket |
Up to five trails per Region per account. A multi-Region trail counts as one in each Region.
Exam trap
A trail can deliver to an S3 bucket or SNS topic in another account, but a CloudWatch Logs log group must be in the same account as the trail.
Log file integrity validation
- CloudTrail hashes each log file with SHA-256. Every hour it writes a digest file that lists those hashes and signs it with SHA-256 with RSA.
- Digest files go in a separate folder of the same bucket. Each digest embeds the signature of the previous one, so a deleted log or a gap is detectable.
- Validation detects modification, deletion and forged files. It does not prevent them. Protect the bucket with a restrictive policy, S3 Object Lock or MFA Delete, and a separate account.
- Enable it per trail, then check files with
aws cloudtrail validate-logs.
Missing or broken delivery
| Symptom | Likely cause |
|---|---|
| Nothing reaches S3 | Bucket policy lacks the CloudTrail statements, wrong account ID in the prefix, trail logging stopped |
| Nothing reaches CloudWatch Logs | The trail's IAM role lacks logs:CreateLogStream and logs:PutLogEvents, or the log group is in another account |
| Large events absent | CloudWatch Logs and EventBridge accept at most 256 KB per event, CloudTrail skips larger ones for them |
| No object-level S3 history | Data events were never enabled |
Related
- CloudWatch Logs
- Metric filters and alarms
- Incident response lifecycle
- Compromised credentials
- Finding validation
Further reading
Automated remediation
Wiring findings to action with EventBridge, Lambda, Step Functions and Systems Manager Automation, Security Hub automation rules and custom actions, Config remediation, and keeping automation safe.
CloudWatch Logs and Agent
Log groups, retention, the unified CloudWatch agent, agent troubleshooting and CloudWatch IAM managed policies.