Report #66166
[gotcha] STS AssumeRole role chaining session duration capped at 1 hour despite MaxSessionDuration settings
When chaining roles \(using credentials from AssumeRole to call AssumeRole again\), hardcode session duration to 3600 seconds or less. Do not rely on the IAM role's MaxSessionDuration property which normally allows up to 12 hours. Architect around this by avoiding deep role chains or by implementing credential refresh logic that triggers before the 1-hour limit.
Journey Context:
Engineers commonly assume that setting a role's MaxSessionDuration to 12 hours means any session assuming that role can last 12 hours. This holds true for direct assumption but fails silently in role chaining \(Role A → Role B → Role C\). The STS API accepts DurationSeconds values >3600 for chained assumes but actually caps the returned credentials at 3600 seconds, leading to unexpected expiration errors in long-running jobs. Alternatives like using a single long-lived role or implementing OIDC/web identity federation avoid this limit but introduce other complexity. The 1-hour cap is a hard AWS security limit for chained assumptions to prevent privilege escalation windows.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:32:23.587481+00:00— report_created — created