When a CloudTrail AccessDenied event names an assumed role, use the session ARN to identify the temporary caller and the session issuer to find the IAM role owner. Corroborate any source identity with issuance evidence, and record gaps before you assign the incident to a caller.
The CloudTrail records below are illustrative. They use invented account IDs and role names. You will follow two fictional sessions with the same name in different accounts, trace one back to its immediate upstream role, and document an S3 object operation the trail did not collect.
Contents
Locate the operation
Operation, error, account and Region
Start with the raw CloudTrail event behind the alert. Keep its full eventID and record eventTime in UTC. Read eventSource and eventName together so the IAM owner has the service and the exact API operation. Copy errorCode as recorded, and keep the relevant portion of errorMessage if it exists. The example matches the literal AccessDenied in the top-level error field. For a different operation, verify how that service reports the error. AWS documents cases where error information is in responseElements. CloudTrail record contents
Record awsRegion, recipientAccountId and userIdentity.accountId separately. The recipient account is the account that received this copy of the event. For an assumed-role request, the identity account owns the role used to obtain the temporary credentials. They match within each of the two example events. If they differ in your incident, preserve both values so the team knows where the event was recorded and which account owns the calling role. Where two accounts receive a copy of the same action and AWS supplies sharedEventID, use it to relate the records and keep each copy’s own event ID. CloudTrail account and event fields
Use eventCategory to confirm what was collected. In the example, GetBucketPolicy and PutBucketPolicy are S3 management operations. GetObject is an object-level operation that needs S3 data event coverage. If all you have is an application report, record its timestamp, operation, bucket and object scope as reported. Check whether the trail covered the account, Region and resource at that time, including read versus write selection. For an S3 object, check whether the relevant AWS::S3::Object scope and applicable bucket or prefix were selected. A policy event for the same bucket only gives evidence about that policy request. S3 event logging coverage
Use this inventory row to keep the reported object operation visible while you examine the two recorded denials. The incident report supplies the requested operation and its reported time. The fictional trail’s selector history supplies the coverage finding.
| Reported time | Account and Region | Reported API and resource | Expected event category | Collection evidence |
|---|---|---|---|---|
| 23 Nov 2026, 09:25 UTC | 444455556666, eu-west-2 | s3.amazonaws.com / GetObject on example-policy-b/demo/report.txt | Data | No collected data event. The trail selected management events only from 09:00 to 10:00 UTC. |
Read the assumed-role record in layers
Session, issuer and source identity
When userIdentity.type is AssumedRole, read userIdentity.arn for the temporary session that made the request. The last segment is the role session name. Keep the whole ARN because names can repeat across roles, accounts and runs. Read userIdentity.sessionContext.sessionIssuer.arn for the IAM role behind the session. The issuer’s userName is the role name when the issuer type is Role. If you have the issuer’s principalId, keep that internal role identifier with the ARN in the evidence. CloudTrail identity and session fields
Read userIdentity.sessionContext.sourceIdentity if it is present, then ask the identity owner how the value was supplied and constrained at issuance. It may come from a caller-supplied value, an identity-provider attribute or a prior hop in a role chain. Ask who could set it, what trust policy or federation mapping applied at the time, and whether the value refers to a workload, another role or a verified user identifier. If you have only the denied event, quote the value as recorded and mark its provenance as unverified. For a missing value, leave source identity unknown. CloudTrail source identity examples
Example walkthrough. Save the two invented version 1.09 records as cloudtrail.json. Both sessions are named operations-run and both roles are named ExampleBucketOperator. Account and session creation time distinguish them. The sample uses the CloudTrail log file’s Records array. If your own local export has a different wrapper, identify its array or individual event objects before adapting the projection.
{
"Records": [
{
"eventVersion": "1.09",
"eventID": "a1000000-1111-4111-8111-000000000001",
"eventTime": "2026-11-23T09:14:22Z",
"awsRegion": "eu-west-2",
"recipientAccountId": "111122223333",
"eventSource": "s3.amazonaws.com",
"eventName": "GetBucketPolicy",
"eventType": "AwsApiCall",
"eventCategory": "Management",
"managementEvent": true,
"readOnly": true,
"errorCode": "AccessDenied",
"requestParameters": {"bucketName": "example-policy-a"},
"responseElements": null,
"userIdentity": {
"type": "AssumedRole",
"principalId": "AROAEXAMPLE1111111111:operations-run",
"accountId": "111122223333",
"arn": "arn:aws:sts::111122223333:assumed-role/ExampleBucketOperator/operations-run",
"sessionContext": {
"sessionIssuer": {
"type": "Role",
"principalId": "AROAEXAMPLE1111111111",
"arn": "arn:aws:iam::111122223333:role/workloads/ExampleBucketOperator",
"accountId": "111122223333",
"userName": "ExampleBucketOperator"
},
"attributes": {"creationDate": "2026-11-23T09:10:00Z"},
"sourceIdentity": "example-deploy-runner"
}
}
},
{
"eventVersion": "1.09",
"eventID": "b2000000-2222-4222-8222-000000000002",
"eventTime": "2026-11-23T09:18:47Z",
"awsRegion": "eu-west-2",
"recipientAccountId": "444455556666",
"eventSource": "s3.amazonaws.com",
"eventName": "PutBucketPolicy",
"eventType": "AwsApiCall",
"eventCategory": "Management",
"managementEvent": true,
"readOnly": false,
"errorCode": "AccessDenied",
"requestParameters": {"bucketName": "example-policy-b"},
"responseElements": null,
"userIdentity": {
"type": "AssumedRole",
"principalId": "AROAEXAMPLE2222222222:operations-run",
"accountId": "444455556666",
"arn": "arn:aws:sts::444455556666:assumed-role/ExampleBucketOperator/operations-run",
"sessionContext": {
"sessionIssuer": {
"type": "Role",
"principalId": "AROAEXAMPLE2222222222",
"arn": "arn:aws:iam::444455556666:role/workloads/ExampleBucketOperator",
"accountId": "444455556666",
"userName": "ExampleBucketOperator"
},
"attributes": {"creationDate": "2026-11-23T09:12:00Z"}
}
}
}
]
}
Save this filter as project-denials.jq and run it with jq 1.7.1 in the directory containing the files. The filter keeps the complete session issuer object and the session creation timestamp for the handoff. Its exact error match is scoped to this example. A missing source identity projects to JSON null.
[
.Records[]
| select(.errorCode == "AccessDenied" and .userIdentity.type == "AssumedRole")
| {
eventVersion, eventID, eventTime, eventSource, eventName, errorCode,
eventCategory, awsRegion, recipientAccountId,
identityAccountId: .userIdentity.accountId,
sessionArn: .userIdentity.arn,
sessionCreatedAt: .userIdentity.sessionContext.attributes.creationDate,
sessionIssuer: .userIdentity.sessionContext.sessionIssuer,
sourceIdentity: .userIdentity.sessionContext.sourceIdentity
}
]
jq -f project-denials.jq cloudtrail.json
The projected GetBucketPolicy row has source identity example-deploy-runner and issuer account 111122223333. The projected PutBucketPolicy row has source identity null and issuer account 444455556666. Both retain their own event ID, UTC time, recipient account and complete session ARN. The inventory row for the object read stays outside this result because its source is the incident report and selector history.
Follow the session to the owner
Session time and issuance records
Use the session’s creationDate to start the search for issuance evidence. The denied API call can occur well after issuance. Ask the team that owns the issuer role for the available STS or federation records around the creation time. Check the accounts involved in issuance and the Region where the STS call was recorded. The denied S3 event’s Region is a useful starting point for the denial and may differ from the Region of the issuance record.
For an available successful AssumeRole, AssumeRoleWithSAML or AssumeRoleWithWebIdentity record, compare the returned responseElements.assumedRoleUser.arn with the denied event’s session ARN. Compare the requested role with the session issuer and confirm that the timing fits. If both records carry source identity, compare the STS requestParameters.sourceIdentity with the downstream session value. The issuance event’s userIdentity describes the principal that made the STS call. If that principal is itself a role session, repeat the same comparison for the earlier hop where evidence is available. CloudTrail identity fields for STS calls and role chains
For federated issuance, ask the identity-provider owner for the audit record that maps the stable subject or workload identifier to the same issuance. Check the provider, application or audience, target role and time. A display name or a similar timestamp gives you a candidate to investigate. Keep the provider’s audit record reference in the case once the owner confirms the mapping. If the issuer is known and the preceding identity remains unresolved, route the investigation to the issuer account’s IAM owner with the unverified hop and the source needed to resolve it.
In this local example, save the following invented STS field extract as sts-evidence.json. It represents one successful issuance in account 111122223333. The STS request carries the same source identity as the first denied event. The immediate STS caller is a session of ExampleDeployBroker. That establishes one upstream hop in this example. The deployment broker audit is the next place to verify the origin of the source value.
[
{
"eventID": "c3000000-3333-4333-8333-000000000003",
"eventTime": "2026-11-23T09:10:00Z",
"eventName": "AssumeRole",
"awsRegion": "eu-west-2",
"requestParameters": {
"roleArn": "arn:aws:iam::111122223333:role/workloads/ExampleBucketOperator",
"sourceIdentity": "example-deploy-runner"
},
"responseElements": {
"assumedRoleUser": {
"arn": "arn:aws:sts::111122223333:assumed-role/ExampleBucketOperator/operations-run"
}
},
"userIdentity": {
"arn": "arn:aws:sts::111122223333:assumed-role/ExampleDeployBroker/broker-run"
}
}
]
Save this small join as correlate-sts.jq. In this example the timestamps have the same second-level precision. The join requires the full session ARN, the full issuer role ARN and exact creation time. It retains all candidates per denial, including an empty array when there is no match. For real records whose timestamps differ in precision, use a justified time window and review additional evidence before picking a candidate. Repeated sessions for the same role can reuse the same session ARN.
map(
. as $denial
| . + {
stsMatches: [
$sts[0][]
| select(
$denial.sessionArn != null
and $denial.sessionIssuer.arn != null
and $denial.sessionCreatedAt != null
and .responseElements.assumedRoleUser.arn == $denial.sessionArn
and .requestParameters.roleArn == $denial.sessionIssuer.arn
and .eventTime == $denial.sessionCreatedAt
)
]
}
)
jq -f project-denials.jq cloudtrail.json |
jq --slurpfile sts sts-evidence.json -f correlate-sts.jq |
jq -c '.[] | {eventID, eventName, recipientAccountId, sourceIdentity, stsMatches: [.stsMatches[].eventID]}'
The local example returns the following two rows.
{"eventID":"a1000000-1111-4111-8111-000000000001","eventName":"GetBucketPolicy","recipientAccountId":"111122223333","sourceIdentity":"example-deploy-runner","stsMatches":["c3000000-3333-4333-8333-000000000003"]}
{"eventID":"b2000000-2222-4222-8222-000000000002","eventName":"PutBucketPolicy","recipientAccountId":"444455556666","sourceIdentity":null,"stsMatches":[]}
Write the case card so the permission question and the attribution question have owners. The first event can go to the role owner in 111122223333 with the corroborated broker hop. For the second, the role in 444455556666 gives the IAM team a starting point and caller attribution stays unresolved. For each denial, share the event reference and enough of the error and request context for the IAM owner to investigate the permission decision separately.
| Event or report | What the event proves | What a second identity record corroborates | Missing time range (UTC) | Responsible team | Next place to check |
|---|---|---|---|---|---|
| 23 Nov 2026, 09:14:22 UTC 111122223333 · eu-west-2 s3.amazonaws.com / GetBucketPolicya1000000-1111-4111-8111-000000000001 | AccessDenied for operations-run. Issuer arn:aws:iam::111122223333:role/workloads/ExampleBucketOperator. Source identity example-deploy-runner. | STS event c3000000-3333-4333-8333-000000000003 matches the session, role, creation time and source value. It identifies the immediate ExampleDeployBroker session. | Issuance at 09:10:00 is covered. Broker audit around that time is still outstanding. | IAM, 111122223333, with deployment platform | Broker audit for the origin of example-deploy-runner. |
| 23 Nov 2026, 09:18:47 UTC 444455556666 · eu-west-2 s3.amazonaws.com / PutBucketPolicyb2000000-2222-4222-8222-000000000002 | AccessDenied for operations-run. Issuer arn:aws:iam::444455556666:role/workloads/ExampleBucketOperator. Source identity absent. | No matching issuance record in the available evidence. Original caller unresolved. | 09:07–09:17 searched for issuance around 09:12:00. Matching STS evidence unavailable. | IAM, 444455556666 | Issuance account’s STS archive or federation audit. |
| 23 Nov 2026, 09:25 UTC (reported) 444455556666 · eu-west-2 s3.amazonaws.com / GetObject | No collected CloudTrail event for the reported object read. Its outcome and caller remain unknown. | No session evidence to join. | 09:00–10:00. Object data events outside trail selection. | Cloud logging, with S3 owner | Check other retained sources and confirm future data event coverage. |
Explain an empty result
Event history, selectors and delivery
Start with the account, the Region and the UTC time window. CloudTrail Event history shows up to 90 days of management events in the selected Region. Data events are outside that view. If you are checking a recent management read such as GetBucketPolicy, clear the default read-only filter that hides reads, then look up the event ID or event name. For a management event beyond the history window, ask the log owner which trails or other archives retained records for that date. CloudTrail Event history and console filters
Next, review the selectors in effect at the incident time. For an object read, verify that the trail was logging data events, that the object was in scope, and that the operation or read category was included. Save the settings evidence or have the logging owner confirm the applicable time range. If the selectors would have included a recent operation, check the trail’s recent S3 deliveries, note the last successful delivery and allow for the trail’s normal delivery interval. Check the destination and time range again before marking a delivery gap. Treat the interval as an estimate and record when you last checked. S3 logging and event selection
If the record already exists in S3, use the CloudTrail integration guide to ingest those events to a Logs stack through the S3 input, then view them in OpenSearch Dashboards. Click Launch Logs on the stack and open Dev Tools. Search the Logs stack index pattern *-* using the raw CloudTrail field names for the event time, account, service and API that you established above. Do not rely on a derived outcome field. The filter values below are from the sample events in this article. Replace them with the values from your own denial.
GET *-*/_search
{
"size": 20,
"sort": [ { "@timestamp": "desc" } ],
"query": {
"bool": {
"filter": [
{ "term": { "errorCode.keyword": "AccessDenied" } },
{ "term": { "eventName.keyword": "GetBucketPolicy" } },
{ "term": { "userIdentity.type.keyword": "AssumedRole" } }
]
}
}
}
If a term filter returns no hits, check the field mapping in Dev Tools with GET *-*/_mapping. Text fields are analysed, so an exact term query may miss. Retry on the .keyword subfield, or without .keyword if you started there and the value lives on the text field. Open a known source record and confirm the field names your pipeline actually stored before you treat an empty result as a delivery gap. If you can locate the event in the source file and your search still returns nothing, give the logging owner the source file reference, event ID and search window so they can check the gap between the two.
Record the absence in the ticket with the checked source, account, Region, operation, resource scope and UTC interval. For this example’s object read, that means the account 444455556666 trail selected only management events between 09:00 and 10:00 UTC. Mark the reported read as lacking a CloudTrail record in that trail. Enabling matching data event selectors covers future requests. Historical evidence depends on a record already captured by another source, such as a retained application or access log. If you find one, record which details it independently supports and keep the CloudTrail coverage gap in the case card. AWS log source overview
Unlock complete visibility with hosted ELK, Grafana, and Prometheus-backed Observability
FAQ
Can I identify the caller from the role session name?
Use the name as a search hint. Attach the full session ARN, issuer ARN and creation time to the ticket. The same label can appear in different accounts or after repeat assumptions of the same role. Ask the IAM owner for the matching issuance record before assigning the request to a caller.
Is source identity always present?
Its presence depends on the session’s issuance path and how source identity was configured or supplied. If present, keep the literal value and ask who could set it. If absent, record it as unknown and look for STS or federation evidence for that session. AWS STS source identity
What if the event has no top-level error code?
Inspect the raw event and check the service’s error representation. AWS documents services that record error details in responseElements. Compare the time and request details with the original alert or application error. If the available records leave the outcome unclear, record that uncertainty in the case. CloudTrail error fields
Why is a recent S3 object read absent from Event history?
Event history covers regional management events for 90 days. Start with the S3 data event selectors and retained trail files for the resource and time in question. If the selection excluded the resource, document the interval and check whether any independent source retained evidence about the request. Event history limits · S3 data event logging
Where should I send a denial when the STS record is missing?
Send the event ID, operation, issuer role and creation time to the IAM owner of the issuer account. Add the accounts, Regions, archives and time window you checked. Mark the original caller unresolved and ask for the specific STS archive, federation record or broker audit that could corroborate the preceding hop.
Can I use a free trial for the log investigation?
The Logit.io free trial includes every feature, including Hosted OpenSearch MCP, which works with any MCP-compatible client. The trial lasts 14 days and requires no credit card. AWS controls trail coverage and the fields present in each source event. Trial and getting started · Hosted OpenSearch MCP
Next steps
- Give the case card to the IAM owner. If the review identifies AWS log sources needed across accounts, review Logit.io’s managed AWS logging destination with the platform team. AWS Logging on Logit.io
- For CloudTrail events your trails already deliver to S3, review the input setup. CloudTrail integration guide
- Use the source overview to identify which other AWS logs belong in the investigation. AWS logging guide
