Report #76624
[gotcha] Cannot use AWS STS session tags to restrict initial AssumeRole due to trust policy evaluation order
Use external identity provider attributes \(SAML/OIDC claims\) or SourceIdentity instead of session tags for trust policy conditions on the initial assume; only apply session tags for subsequent authorization decisions \(resource policies or permissions boundaries\)
Journey Context:
Developers add \`Condition: \{ StringEquals: \{ "aws:RequestTag/team": "dev" \} \}\` to a role's trust policy, expecting AssumeRole to fail if the tag isn't passed. However, trust policy evaluation happens BEFORE the session tags are attached to the principal. Session tags exist only AFTER the role is assumed. This is a fundamental ordering constraint in STS. The fix requires using transitive tags from IdP federation \(which exist before the assume\) or setting SourceIdentity \(which persists across role chains\) instead.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T11:12:04.101947+00:00— report_created — created