A twelve hour session
Needs the role's MaxSessionDuration raised, and is capped at an hour if chained
- session
- alice@example.com
- duration
- 43200
- role
- arn:aws:iam::111122223333:role/Deployer
Build the call, and see the two duration rules that catch people: the role's own maximum, and the separate cap that applies when you chain.
Worked setups you can load into the form above. Each one is a decision the generator makes differently, and the reason it makes it.
Needs the role's MaxSessionDuration raised, and is capped at an hour if chained
Almost always needs an external id, which their trust policy will require
These are the ones that fail silently. The config is accepted, nothing raises an error, and the consequence arrives later.
If the credentials you are using came from an assumed role, this is chaining, and STS caps it at one hour without erroring.
Instead:Assume the second role from the original credentials rather than from the first role.
Credentials already issued keep working until they expire. There is no revoke call.
Instead:Add a deny with a condition on aws:TokenIssueTime, and keep durations short.
CloudTrail then shows a stream of identical assumed-role identities with nothing to distinguish who or what was behind each.
Instead:Use an email address, a pipeline run id or a hostname.
Assuming a role using credentials that came from another assumed role is chaining. STS caps that at one hour and silently ignores a longer DurationSeconds rather than erroring.
A request longer than an hour fails unless the role's MaxSessionDuration has been raised, and the error names the duration rather than the role setting, so people adjust the request instead. Twelve hours is the ceiling.
There is no revoke call. Deleting the role, detaching its policies or removing the trust does not invalidate sessions already issued: they work until they expire. A twelve hour session that leaks is twelve hours of access, which is the argument for short durations.
An inline deny policy on the role with a condition on aws:TokenIssueTime invalidates everything issued before a moment. It is the mechanism the console's revoke button uses, and it is worth knowing exists before you need it.
It appears in CloudTrail and in aws:userid. A session name of session or temp makes every entry indistinguishable, which is discovered during an investigation rather than before one. It can also be constrained in the trust policy with a condition on sts:RoleSessionName.
It is not a secret and not authentication. It stops the third party being tricked into using your role on behalf of another of their customers, which makes their confused deputy problem yours to opt out of.
role_arn and source_profile in ~/.aws/config make the SDK fetch and refresh the credentials for you, rather than handing you three environment variables that expire mid-task.