AWS CloudTrail and GuardDuty evidence review
Brief
Every enumeration and escalation step in an AWS test is an API call, and the defender's view in the report says which of those calls CloudTrail kept and which ones GuardDuty raised. The review is read-only, runs after testing ends, and treats a missing trail or a silent detector as a finding in its own right.
On this page
- Situation
- A finished AWS test, our operator log with the UTC time, source address, access key id and call for each step, and a read-only review role in each account in scope with CloudTrail and GuardDuty read (the
SecurityAuditmanaged policy covers both), plus read on the log archive bucket where the client grants it. Every command here reads logs, trail settings or findings; nothing changes a trail, a detector, a suppression rule or a finding, and only the accounts and regions the scope letter names are reviewed. - Goal
- A defender's view section: each test step matched to the CloudTrail event and GuardDuty finding it produced, or to the gap that hid it.
- Outputs
- Representative examples on placeholder hosts, trimmed to the lines that matter. Not captured from a public fixture yet.
Check first
- Our operator log for the test: UTC time, source address, access key id or role session name, and the call for each step. The review matches against it line by line.
- The test window, and the client's word that testing has ended, so every event in the window from our key is ours.
- A review role separate from the identity we tested with, so its own reads are easy to tell apart.
- Where the organization trail lands: usually a log archive account the review role cannot read unless the client grants read on that bucket.
- Whether GuardDuty is on in every region the test touched, and whether suppression rules archive findings on arrival.
Steps
AWS
Which trails record the account, and what do they leave out?
aws cloudtrail describe-trails --include-shadow-trails \
--query 'trailList[].[Name,HomeRegion,IsMultiRegionTrail,IsOrganizationTrail,LogFileValidationEnabled]' --output text
aws cloudtrail get-trail-status --name arn:aws:cloudtrail:us-east-1:999988887777:trail/org-trail \
--query '[IsLogging,LatestDeliveryTime]' --output text
aws cloudtrail get-event-selectors --trail-name arn:aws:cloudtrail:us-east-1:999988887777:trail/org-trail \
--query 'AdvancedEventSelectors[].FieldSelectors[?Field==`eventCategory`][].Equals[]' --output text
Expected output
org-trail us-east-1 True True True
True 2026-10-27T18:04:11.522000+00:00
Management # <- management events only: object reads and function invokes were never recorded
An organization trail appears in a member account as a shadow trail, which is why the commands name it by ARN. A trail set up with basic selectors answers under EventSelectors instead. Event history keeps 90 days of management events in each region whatever the trails say, so a missing trail does not mean no record. It means no record past 90 days, no data events and nothing to query across accounts.
Negative result. A multi-region organization trail that is logging, with file validation on and data events on the buckets the test read.
Fix. One multi-region organization trail with log file validation, delivered to a log archive account the workload accounts cannot write to, with data events on buckets that hold customer data.
What did CloudTrail record for each step we took?
aws cloudtrail lookup-events --region us-east-1 \
--start-time 2026-10-27T13:00Z --end-time 2026-10-27T18:00Z \
--lookup-attributes AttributeKey=AccessKeyId,AttributeValue=AKIAIOSFODNN7EXAMPLE \
| jq -r '.Events[].CloudTrailEvent | fromjson
| [.eventTime, .eventName, .sourceIPAddress, (.errorCode // "-"), .eventID] | @tsv'
Expected output
2026-10-27T14:31:52Z AssumeRole 203.0.113.24 - 5b2e9c41-7d3a-4f60-9e18-c2a4d6f0b937 # <- the escalation step
2026-10-27T14:22:10Z ListRoles 203.0.113.24 - 0d8f3a26-1c5e-4b97-a2d4-6e9f0b3c7a15
2026-10-27T14:20:47Z GetAccountAuthorizationDetails 203.0.113.24 AccessDenied e41c7b90-3f2a-4d68-8b5e-9a0c1d2e7f46 # <- refused calls are recorded too
2026-10-27T14:20:31Z ListAttachedUserPolicies 203.0.113.24 - 7a9d2e15-6b4c-4f03-b8e1-2c5d0a3f9b72
2026-10-27T14:20:02Z GetCallerIdentity 203.0.113.24 - c3f60b28-9e1d-4a75-8c2b-4d7e1f0a6b93
Event history includes read-only management events, which is most of an enumeration. IAM and the global STS endpoint record in us-east-1; calls to a regional endpoint record in that region, so the lookup runs in every region the test touched. The role session that AssumeRole issued has its own temporary key id, read from responseElements.credentials.accessKeyId in that event with nothing else from that block printed; a second lookup on it follows the escalation. Each event id goes in the report beside the step it proves.
Negative result. Every step in our log has an event from our address and key. A step with no event is a data event, a skipped region or a call that never reached AWS; say which before calling it a gap.
Fix. Keep management events beyond 90 days in the organization trail or CloudTrail Lake, so the same lookup works for an attacker's key found months later.
Was the trail stopped, changed or altered in the window?
for e in StopLogging DeleteTrail UpdateTrail PutEventSelectors; do
aws cloudtrail lookup-events --region us-east-1 --start-time 2026-10-20T00:00Z \
--lookup-attributes AttributeKey=EventName,AttributeValue=$e --query 'length(Events)' --output text
done
aws cloudtrail validate-logs --trail-arn arn:aws:cloudtrail:us-east-1:999988887777:trail/org-trail \
--start-time 2026-10-27T13:00Z --end-time 2026-10-27T18:00Z
Expected output
0
0
0
0
Validating log files for trail arn:aws:cloudtrail:us-east-1:999988887777:trail/org-trail between 2026-10-27T13:00:00Z and 2026-10-27T18:00:00Z
Results requested for 2026-10-27T13:00:00Z to 2026-10-27T18:00:00Z
Results found for 2026-10-27T13:00:00Z to 2026-10-27T18:00:00Z:
5/5 digest files valid
212/212 log files valid # <- no log file deleted or changed since delivery
The counts run in the account that owns the trail, since changes to an organization trail are recorded there. validate-logs reads the hourly digest files, so it needs validation on and read on the bucket, and changes nothing.
Negative result. Zero on every count and every file valid. A count above zero in the window is not our activity; tell the client that hour.
Fix. Deny the four trail changes to everyone but the security account with an SCP, and alert on each; GuardDuty raises Stealth:IAMUser/CloudTrailLoggingDisabled when a trail is deleted or updated.
Which GuardDuty findings match our activity?
det=$(aws guardduty list-detectors --region us-east-1 --query 'DetectorIds[0]' --output text)
ids=$(aws guardduty list-findings --region us-east-1 --detector-id "$det" \
--finding-criteria '{"Criterion":{"resource.accessKeyDetails.accessKeyId":{"Eq":["AKIAIOSFODNN7EXAMPLE"]}}}' \
--query 'FindingIds' --output text)
aws guardduty get-findings --region us-east-1 --detector-id "$det" --finding-ids $ids \
--query 'Findings[].[Type,Severity,Service.Count,Service.EventFirstSeen,Service.Archived]' --output text
Expected output
PenTest:IAMUser/KaliLinux 5.0 14 2026-10-27T14:20:02.000Z False
Discovery:IAMUser/AnomalousBehavior 2.0 1 2026-10-27T14:20:47.000Z True # <- raised, then archived by a suppression rule
Findings are regional, so this runs per region. PenTest:IAMUser/KaliLinux is Medium and fires on the user agent our tools sent; Discovery:IAMUser/AnomalousBehavior is Low and comes from a model that weighs the identity's history. PrivilegeEscalation:IAMUser/AnomalousBehavior watches calls that change policies, users and groups, so an AssumeRole the trust policy allows raised nothing here. An archived finding was raised but is hidden from the default findings view; whether anyone acted is a question for the client's ticket queue.
Negative result. An active finding for each step the client expected to detect, and a ticket showing someone read it.
Fix. Turn GuardDuty on in every enabled region through a delegated administrator, route Medium and above to a queue someone works, and review suppression rules each quarter.
The defender sees
Our review's own reads appear first: LookupEvents, DescribeTrails, GetTrailStatus, GetEventSelectors, ListFindings and GetFindings under the review role, and reads of digest files in the log bucket. The report names them so nobody chases them.
Then the test itself, step by step:
| Our step | What CloudTrail kept | What GuardDuty raised |
|---|---|---|
| Identity and policy reads | GetCallerIdentity, ListAttachedUserPolicies, one refused GetAccountAuthorizationDetails | PenTest:IAMUser/KaliLinux, Medium, active |
| Role enumeration | ListRoles | Discovery:IAMUser/AnomalousBehavior, Low, archived |
| Escalation into the admin role | AssumeRole, then the session's calls under its own key id | Nothing |
| One object read in the exports bucket | Nothing: no data events on that bucket | Nothing |
The paragraph in the report says, in this order, what was recorded, what was not and why, what alerted, and whether anyone acted:
Defender's view. CloudTrail recorded every management call we made: 41 events
between 14:20 and 17:42 UTC on 27 Oct 2026, each listed by event id in appendix B.
It did not record our read of one object in the exports bucket, because the
organization trail logs management events only. GuardDuty raised two findings
on our first calls; one was archived on arrival by a suppression
rule, and neither produced a ticket. The escalation raised nothing. An attacker
holding the same key would have been recorded and not stopped.
It describes our activity only and never claims the account is clean of anyone else's. Where nothing was recorded or nothing alerted, write that as its own finding with the cloud finding write-up, beside the issue the test found.
Done when
Every step in our operator log is matched to an event id or marked as not recorded with the reason, trail coverage and integrity are stated, every GuardDuty finding from our activity is listed with type, severity and whether it was archived, and the defender's view paragraph is written.
Not covered
Proving reach (see cloud impact without damage), response to a real compromise, Security Hub and SIEM rules, and Entra ID, which has its own page; the outputs shown are representative examples on placeholder accounts, not captured runs.