Skip to content
WETNav

Amazon Web Services

AWS CloudTrail

Every AWS API call: who called it, with which credential, from where, and whether it succeeded.

Why it matters

A leaked access key is investigated entirely from CloudTrail: the first credential check, the enumeration, the persistence it set up, and any logging it turned off.

How long it lasts

  • Event history: 90 days of management events, per region, with no setup.
  • Trails to S3 or CloudTrail Lake keep events as long as you configure. Data events, such as S3 object reads, are recorded only if a trail enables them.
Plan collection order across every source

Get the data

aws cloudtrail lookup-events --region us-east-1 \
  --lookup-attributes AttributeKey=AccessKeyId,AttributeValue=AKIAEXAMPLE123456789 \
  --start-time 2026-01-01T00:00:00Z --max-results 50

Fields that matter

eventName / eventSource

The API call and the service.

userIdentity.type

Root, IAMUser, AssumedRole and others.

userIdentity.arn

The principal that made the call.

userIdentity.accessKeyId

AKIA for long-term keys, ASIA for temporary STS credentials.

sourceIPAddress

Source IP, or an AWS service name when a service called on your behalf.

userAgent

SDK, CLI or console. Unusual values point to tooling.

errorCode

AccessDenied and UnauthorizedOperation in bulk show permission enumeration.

requestParameters / responseElements

What was asked for and what came back, such as the policy attached or the key created.

awsRegion

Activity in regions you never use is a classic sign of abuse.

Values to know

Traps

  • Event history is per region. An attacker working in a region you do not use is invisible if you only look at your home region.
  • Without data events, S3 GetObject is not logged. You may be unable to prove what data was read.
  • lookup-events is rate limited and returns 50 events per page. Use a trail and Athena for anything bigger than a quick check.

Playbooks that use it