Sub topic 1
What CloudTrail records and why it matters for auditing
Prerequisites
Assume you understand IAM users, roles, and policies, can read JSON, and have basic AWS CLI experience. You also need access to an AWS account for commands that create or query CloudTrail resources.
What CloudTrail records and why it matters for auditing
AWS CloudTrail records activity in an AWS account. It captures many AWS API calls and related account events, including the identity that made a request, the operation, the time, the Region, and the request source. These records help answer who did what, when, and from where.
CloudTrail does not record every application action. For example, it usually records an API call that changes an Amazon S3 bucket, but not every business operation inside an application that uses that bucket. Coverage also depends on the event category and the selectors configured for a trail.
Reading a CloudTrail event record
A CloudTrail event is a JSON object. The userIdentity field identifies the actor. eventName and eventSource identify the operation. eventTime gives the timestamp, while sourceIPAddress and userAgent describe the request source. Resource and request details commonly appear in requestParameters. A failed request usually includes errorCode and errorMessage.
{
"userIdentity": {
"type": "IAMUser",
"arn": "arn:aws:iam::123456789012:user/alice"
},
"eventTime": "2026-11-20T09:15:42Z",
"eventSource": "cloudtrail.amazonaws.com",
"eventName": "StopLogging",
"awsRegion": "us-east-1",
"sourceIPAddress": "203.0.113.10",
"requestParameters": {
"name": "org-audit-trail"
},
"readOnly": false
}Management, data, and Insights events
CloudTrail groups events by purpose:
- Management events describe control-plane operations, such as creating an IAM role or changing a security group.
- Data events describe high-volume access to resources, such as reading an S3 object or invoking a Lambda function. You select which resources to record.
- Insights events identify unusual patterns, such as a sudden increase in API calls. They require separate enablement and can add cost.
flowchart TD
A[CloudTrail event] --> B[Management]
A --> C[Data]
A --> D[Insights]
B --> E[Account configuration]
C --> F[Resource access]
D --> G[Unusual activity]Searching recent activity with Event history
Event history provides recent management events in a Region without requiring a trail. It is useful for quick checks, but it is not a replacement for long-term delivery to S3 or CloudTrail Lake. Use the CLI to find calls such as StopLogging:
aws cloudtrail lookup-events \
--lookup-attributes AttributeKey=EventName,AttributeValue=StopLogging \
--max-results 10The result includes event records that you can inspect for the actor, time, source, and request details.
Exercise
Which event category should you enable to record reads of objects in one sensitive S3 bucket?
Show answer
Data events, filtered with an event selector for that bucket.