Sub topic 2
Reading a CloudTrail event record
This chapter assumes you know basic IAM concepts (users, roles, policies), can read JSON, and have used the AWS CLI. You will learn to read one CloudTrail event and pull out who acted, what they did, what they acted on, where the call came from, and whether it worked.
Why the record structure matters
CloudTrail writes each recorded API call as a JSON object called an event record. Every investigation starts by reading these records. If you know which field answers which question, you can skim a record in seconds and filter on the right field when you search.
A worked example
Here is a trimmed event. Someone stopped a trail named org-audit-trail.
{
"eventVersion": "1.09",
"userIdentity": {
"type": "IAMUser",
"arn": "arn:aws:iam::123456789012:user/alice",
"accountId": "123456789012",
"userName": "alice"
},
"eventTime": "2026-11-20T09:15:42Z",
"eventSource": "cloudtrail.amazonaws.com",
"eventName": "StopLogging",
"awsRegion": "us-east-1",
"sourceIPAddress": "203.0.113.10",
"userAgent": "aws-cli/2.x",
"requestParameters": { "name": "org-audit-trail" },
"readOnly": false,
"eventType": "AwsApiCall",
"recipientAccountId": "123456789012"
}Mapping fields to questions
| Question | Field | In this example |
|---|---|---|
| Who? | `userIdentity` | IAM user `alice` in account 123456789012 |
| What? | `eventSource` and `eventName` | `StopLogging` on the CloudTrail service |
| When? | `eventTime` | 2026-11-20 at 09:15:42 UTC |
| Where from? | `sourceIPAddress` and `userAgent` | 203.0.113.10, using the AWS CLI |
| On what? | `requestParameters` | the trail `org-audit-trail` |
| Which Region? | `awsRegion` | us-east-1 |
The actor: userIdentity
The type field tells you what kind of principal made the call. Common values are IAMUser, AssumedRole, Root, AWSService, and FederatedUser. Always check it first, because the other fields vary by type.
For an AssumedRole event, the arn points to the temporary session, not to a person. The session name at the end of the ARN, and the sessionContext block, show which role was assumed and often who assumed it. A Root type event deserves attention in almost any account, because the root user should rarely be used.
The action: eventSource and eventName
eventSource names the service endpoint, and eventName names the API operation. Together they identify the call precisely. Many services share operation names such as Delete or Put variants, so use both fields when you filter.
The time and place
eventTime is always in UTC. Convert before you compare it with logs kept in local time. sourceIPAddress can also hold a service name such as cloudformation.amazonaws.com when one AWS service calls another on a user's behalf. userAgent tells you whether the call came from the console, an SDK, or the CLI, which helps you spot unusual tooling.
The target and the outcome
requestParameters holds the inputs to the call. responseElements holds what the service returned, and it is usually present for write calls that create or change something. Some sensitive values are redacted in these blocks.
CloudTrail has no single "success" field. Look for an errorCode and errorMessage at the top level. If they are absent, the call was accepted. Values like AccessDenied or UnauthorizedOperation mean the call was rejected. Denied calls are still recorded, and a burst of them from one principal is a useful warning sign.
Reading order that works
- Check
userIdentity.typeandarnto identify the principal. - Read
eventSourceandeventNameto learn the action. - Check for
errorCodeto see whether the call succeeded. - Read
requestParametersto find the target. - Review
sourceIPAddress,userAgent, andawsRegionfor anything unexpected.
Common mistakes
- Treating
eventTimeas local time. It is UTC. - Reading an
AssumedRoleARN as a person. Trace it to the session or identity behind it. - Assuming a missing
errorCodemeans nothing changed. CheckreadOnlytoo. - Matching on
eventNamealone. IncludeeventSource.
Exercise
An event has userIdentity.type "AssumedRole", eventName "DeleteBucket", and an errorCode of "AccessDenied". Did the bucket get deleted, and is the event still worth reviewing?
Show answer
The bucket was not deleted, because the AccessDenied error means the call was rejected. The event is still worth reviewing. CloudTrail records denied calls, and an unexpected role attempting a deletion may point to probing or a misconfigured permission.