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.
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 50Fields that matter
The API call and the service.
Root, IAMUser, AssumedRole and others.
The principal that made the call.
AKIA for long-term keys, ASIA for temporary STS credentials.
Source IP, or an AWS service name when a service called on your behalf.
SDK, CLI or console. Unusual values point to tooling.
AccessDenied and UnauthorizedOperation in bulk show permission enumeration.
What was asked for and what came back, such as the policy attached or the key created.
Activity in regions you never use is a classic sign of abuse.
Values to know
eventName
All values- getcalleridentityGetCallerIdentityReturns the identity behind the credentials. Needs no permissions.Suspicious
- consoleloginConsoleLoginSign-in to the AWS console.Depends on context
- createaccesskeyCreateAccessKeyA new access key was created for an IAM user.High signal
- createuserCreateUserA new IAM user was created.High signal
- createloginprofileCreateLoginProfileA console password was created for an IAM user.High signal
- updateloginprofileUpdateLoginProfileAn IAM user's console password was changed.Suspicious
- attachuserpolicyAttachUserPolicyA managed policy was attached to a user.High signal
- putuserpolicyPutUserPolicyAn inline policy was added to a user.High signal
- attachrolepolicyAttachRolePolicyA managed policy was attached to a role.Suspicious
- updateassumerolepolicyUpdateAssumeRolePolicyA role's trust policy was changed.High signal
accessKeyId
All valuesTraps
- 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.