Files
floci/tools/aws/sources/sts-source-identity.json
T
Priamo Germosen 7d3049d218 fix(iam): read a federated assume's source identity from its assertion or token (#9708)
Under enforcement a role whose trust policy conditions AssumeRoleWithSAML or AssumeRoleWithWebIdentity on sts:SourceIdentity refused every assume, and one that withheld sts:SetSourceIdentity was never consulted: neither operation read the source identity its identity provider sets, so the session carried none, the response returned none and its requests carried no aws:SourceIdentity. The Service Reference gives both actions sts:SourceIdentity but lists no authorized actions for either operation, and botocore models the value only in the response.

The IAM user guide's page on source identity, which tools/aws/fetch_sts_source_identity.py already vendors, says where each carries it, "to set a SAML attribute for source identity, include the Attribute element with the Name attribute set to https://aws.amazon.com/SAML/Attributes/SourceIdentity" and "include source identity in the https://aws.amazon.com/source_identity namespace in the token", and what it needs, "trust policies for all roles connected to an identity provider (IdP) must have the sts:SetSourceIdentity permission". The fetcher now copies those sentences too, and regen_iam_authorized_actions.py gives each operation a companion naming the attribute or the claim and the key it is read as, where the reference's action of the operation's name takes sts:SourceIdentity.

STS reads the value the table names, holds it to botocore's sourceIdentityType (the shape botocore gives the response's SourceIdentity, as it does AssumeRole's member), and refuses several values or one outside it with InvalidIdentityToken. The trust policy reads it as sts:SourceIdentity, through the keys the federated trust evaluators already read in full, and is checked for sts:SetSourceIdentity before the assume, as for AssumeRole. The session records it under aws:SourceIdentity, which a session assumed from it carries on, and the response returns it.

Part of #6640.
2026-11-28 23:02:42 -04:00

43 lines
2.6 KiB
JSON

{
"_source": {
"page": "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html",
"fetcher": "tools/aws/fetch_sts_source_identity.py",
"retrieved": "2026-11-29",
"note": "The page's sentences on setting a source identity, copied as they stand, with what each names: the API parameter each operation's section passes it in, the action setting one needs and its chained form, the keys a request carries it as, and its persistence through a chain."
},
"keys": [
{
"operation": "AssumeRole",
"member": "SourceIdentity",
"row": "To pass source identity while assuming a role, use the -\u2013source-identity AWS CLI option or the SourceIdentity AWS API parameter.",
"key": "sts:SourceIdentity"
}
],
"federated": [
{
"operation": "AssumeRoleWithSAML",
"attribute": "https://aws.amazon.com/SAML/Attributes/SourceIdentity",
"row": "To set a SAML attribute for source identity, include the Attribute element with the Name attribute set to https://aws.amazon.com/SAML/Attributes/SourceIdentity.",
"key": "sts:SourceIdentity"
},
{
"operation": "AssumeRoleWithWebIdentity",
"claim": "https://aws.amazon.com/source_identity",
"row": "Include source identity in the https://aws.amazon.com/source_identity namespace in the token",
"key": "sts:SourceIdentity"
}
],
"permission": {
"action": "sts:SetSourceIdentity",
"sentence": "To specify a source identity, principals (IAM users and roles) must have permissions to sts:SetSourceIdentity.",
"chaining": "When you assume a role with another role, called role chaining, permissions for sts:SetSourceIdentity are required in both the permissions policy of the principal who is assuming the role and in the role trust policy of the target role.",
"identityProvider": "Trust policies for all roles connected to an identity provider (IdP) must have the sts:SetSourceIdentity permission."
},
"sessionKey": {
"key": "aws:SourceIdentity",
"sentence": "When an identity sets a source identity, the sts:SourceIdentity key is present in the request. For subsequent actions taken during the role session, the aws:SourceIdentity key is present in the request.",
"chained": "Therefore, both the aws:SourceIdentity and sts:SourceIdentity keys are present in the request context."
},
"persists": "The value that is set persists when a role is used to assume another role through the AWS CLI or AWS API, known as role chaining. The value that is set cannot be changed during the role session."
}