Monitoring and Logging

A CloudTrail event for a DeleteBucket call shows userIdentity.type AssumedRole and the role ProdDeployRole as the session issuer. Several pipelines and engineers assume ProdDeployRole, each with its own role session name. Which field identifies the session that made the call?

Show the answer

Correct answerC. The role session name at the end of userIdentity.arn

AWhy not this: The session issuer is the role itself, which all pipelines and engineers share, so it does not tell their sessions apart.

BWhy not this: invokedBy names the AWS service that made the request on the caller's behalf, not which session made it.

CWhy this is right: The assumed-role ARN ends with the role session name, which is different for each caller.

DWhy not this: recipientAccountId is the account that received the event, not the caller's session.

For an assumed role, userIdentity.arn has the form arn:aws:sts::account:assumed-role/RoleName/SessionName, so its last part names the session that made the call. The session issuer identifies only the role, which every caller shares.