An audit entry names an assumed-role session, not a person — how do you prove who acted?
answer
- the actor is a session, not a person
- principal id joins role id and session name
- pivot on session creation time
- the earlier hop may be another account's trail
- immutable source identity survives chaining
basics
~20 sWalk the chain backwards. The session identifier in the entry links to the role-assumption call that created it, and that call's own identity is the caller. Repeat for each hop until you reach an identity authenticated by a human login.
solid answer
~50 sThe entry names a role session: a principal id of the form `AROA...:session-name`, a session ARN, and a `sessionContext` giving the issuing role and the session creation time. None of that is a person. To attribute it, find the assume-role event whose response created this exact session and read *its* `userIdentity` — that is the caller. If the caller is itself a role session, repeat; chains cross accounts, so an earlier hop may sit in a trail you do not own. Only at the end, in a federated or interactive login, does an identity-provider record tie the session to a human and to MFA. Then challenge your own claim: unless the identity provider set it, the session name is chosen by whoever assumed the role, the role may be shared by ten engineers and a pipeline, and two sessions can overlap in time.
code
json · 15 lines{
"eventTime": "2026-05-14T02:44:31Z",
"eventName": "AttachRolePolicy",
"sourceIPAddress": "34.201.14.9",
"userIdentity": {
"type": "AssumedRole",
"principalId": "AROA3EXAMPLEID:deploy-9f31",
"arn": "arn:aws:sts::210987654321:assumed-role/PlatformDeploy/deploy-9f31",
"accountId": "210987654321",
"sessionContext": {
"sessionIssuer": { "type": "Role", "userName": "PlatformDeploy", "arn": "arn:aws:iam::210987654321:role/PlatformDeploy" },
"attributes": { "creationDate": "2026-05-14T02:38:11Z", "mfaAuthenticated": "false" }
}
}
}go deeper
Recognise that an assumed-role entry names a session, not a user, and know that the session name and the role name are separate things.
Be able to describe the walk-back: find the assumption event for that session by creation time, read its caller, and repeat until you reach a login at the identity provider.
Show that you volunteer the weaknesses — caller-chosen session names, shared roles, cross-account gaps, overlapping sessions — and that you can state a finding as an evidenced chain rather than a name.
Own the estate-level fix: immutable propagated source identity, per-person sessions instead of shared roles, and cross-account audit access agreed before an investigation needs it.
## The problem In a modern cloud estate almost nothing acts as a named user. A person authenticates to an identity provider, receives a federated session, assumes a role, and that role assumes another role in a different account. Every audit entry after the first hop names **the role session**, not the human. As a forensic examiner you may have to defend the sentence "this named person performed this action", and the fields in front of you do not say that. ## What the identity block actually contains A typical assumed-role identity block carries: - `type`: the class of principal — an assumed role rather than a user. - `principalId`: the role's internal id joined to the **session name**, e.g. `AROA3EXAMPLEID:deploy-9f31`. - `arn`: the session ARN, which repeats the role name and session name. - `sessionContext.sessionIssuer`: the role that was assumed, by name and ARN, and the account that owns it. - `sessionContext.attributes.creationDate`: when the session was created — the key pivot. - `sessionContext.attributes.mfaAuthenticated`: whether MFA was part of the originating authentication. The same shape exists elsewhere. In Google Cloud, `protoPayload.authenticationInfo.principalEmail` may be a service account while `serviceAccountDelegationInfo` names the originating principal that impersonated it. In Azure, the caller on an activity-log entry may be an object id belonging to a service principal, with the human only visible in the directory sign-in records. ## The walk-back procedure 1. **Fix the session.** Take the principal id and session name from the entry under investigation, and the session creation time. 2. **Find the assumption event.** Search for the role-assumption call whose response produced that exact session, bounded to the creation timestamp. Its own `userIdentity` is the caller — the previous hop. 3. **Ask whether the caller is human-authenticated.** If it is another role session or a workload identity, repeat step 2 for that hop. If it is a federated login, move to the identity provider. 4. **Cross the account boundary consciously.** A role in account B is often assumed by a principal in account A, and the assumption event is recorded in the *caller's* account. If a different team, a vendor or an unowned account holds that trail, your chain has a gap you must state rather than paper over. 5. **Land on an authentication event.** Only the identity provider's sign-in record ties a session to a human, a device, a source address and whether MFA was satisfied. That record — not the cloud audit entry — is what carries the person. 6. **Bracket the session window.** Creation time plus session duration bounds every action that session could have taken, which both scopes your timeline and limits over-claiming outside the window. ## What breaks the attribution, and you must say so before the other side does - **The session name is not an authenticated field in every path.** When a principal calls assume-role directly it chooses the session name freely, so `deploy-9f31` or even `alice` proves nothing on its own. When a federated identity provider sets it from the assertion, it is attested by that provider — different provenance, different weight, and you should know which path applied. - **Shared roles collapse people together.** If ten engineers and a deployment pipeline all assume the same role, the role name attributes nothing; only the earlier hop does. - **Overlapping sessions.** Two humans holding sessions from the same role at the same time can only be separated by session name, source address and the assumption events, not by the action entries themselves. - **Chain gaps.** A missing trail in an upstream account ends the walk. The honest output is "a session created at 02:38 by a caller in account A, which I cannot resolve further". - **A credential is not a body.** Even a clean chain to a named person's federated session proves that person's credential and session were used. Session theft, a shared workstation and a token lifted from a developer machine all produce identical records. ## The one field designed for this Some platforms let the originating identity be stamped into the session as an **immutable source identity** that propagates through every subsequent assumption and appears on every downstream entry. Where that is configured, the walk-back collapses to reading one field, and because later hops cannot overwrite it, it survives chaining. Where it is not configured, the walk-back is the only method — and recommending it be turned on is the correct forward-looking half of the answer. ## How to state the finding Write the chain, not the conclusion: session S, created at time T by caller C, which was itself created by federated login L for user U, authenticated with MFA from address A. Every arrow is a record you can produce. That is a claim you can defend when the identity fields are challenged; "the logs show Alice deleted it" is not.
- The session name in the entry is a person's username. Is that enough to name them?Only if you know which assumption path set it. When a principal calls assume-role directly, the session name is a free-text string the caller picks, so anyone with the role can write any name into it — including a plausible one. When a federated identity provider populates it from the assertion, it is attested by that provider. Establish the path before you rely on the string.
- The chain crosses into an account another team owns and you cannot get their logs. What do you report?Report the chain you can evidence and name the gap explicitly: a session issued at a stated time to a caller in that account, unresolved beyond that point. Then escalate the access request as an incident dependency. An attribution stated as complete when a hop is missing is the claim that collapses under challenge.
- How would you make this walk-back unnecessary next time?Configure an immutable source identity that is stamped at the first assumption and propagates across every later hop, so the originating principal appears on every downstream entry. Pair it with per-person role sessions rather than one shared role, and enforce a session-name convention set by the identity provider rather than by the caller.
It is a chain of hire cars. Each audit entry gives you the plate of the car that was driven; to reach the driver you need the rental agreement for that car, then the agreement for the car the renter arrived in, until you reach someone who showed a passport.
saying these in an interview costs you the question
- Reading the role name as the identity of a person
- Trusting a caller-supplied session name as authenticated
- Forgetting the assumption event lives in the caller's account
- Claiming a person acted when only a session is evidenced
- Ignoring that two sessions from one role can overlap in time