Repository navigation
feat(#1613): STS/IAM federation: OIDC and SAML providers, AssumeRoleWithWebIdentity and AssumeRoleWithSAML - #1700
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Nov 24, 2026
scttfrdmn
force-pushed
the
feat/v0134-federation
branch
from
November 25, 2026 00:41
2e4ee7a to
b6f2137
Compare
scttfrdmn
force-pushed
the
feat/v0134-federation
branch
from
November 25, 2026 01:06
b6f2137 to
a469592
Compare
…ty and AssumeRoleWithSAML - IAM: OpenID Connect providers (CRUD, thumbprints, client IDs, tags) and SAML providers (CRUD, metadata, encryption mode, private-key IDs, tags), with authz resource rows, state keys and a seedable OpenIdIdpCommunicationError. - STS: the federated assumes check claims (issuer, audience, expiry on the simulated clock, the SAML Role pair) and the trust policy's Federated principal with the provider condition keys; IdP outcomes are seedable through /v1/sts/federation-outcome. - Routing: an unsigned request with only Action=AssumeRoleWith* reaches STS. - CloudFormation: AWS::IAM::OIDCProvider and AWS::IAM::SAMLProvider.
…ty, MaxSessionDuration, SAML issuer and audience - Session policies (Policy, PolicyArns) on AssumeRole and the federated assumes are stored on the session and applied as an intersection at both authorization doors. - Federated session tags and SourceIdentity require sts:TagSession and sts:SetSourceIdentity, reach aws:PrincipalTag/* and aws:SourceIdentity, and SourceIdentity is returned. - DurationSeconds is bounded by the role's MaxSessionDuration; SAML SessionDuration is no longer the API default. - SAML: the assertion's Issuer must be an entityID the metadata declares, and its Audience must be AWS's; NotBefore and nbf are checked; a token with no sub is refused and condition keys are published only for present claims. - CFN: a dropped ThumbprintList clears the live list and a dropped AssertionEncryptionMode returns a Required provider to Allowed. - The OIDC create seed's read error is wrapped.
…es not read it as a tag
…tion and replay; AssumeRole session tags, source identity and chaining - Session policies narrow the EC2/ELB tag-on-create, S3 copy-source and S3 create-side-effect passes, and still apply when the role's policies cannot be read. - Events record the caller's session (policies, tags, transitive keys, source identity) and replay rebuilds the caller from it; a CloudFormation stack persists its creator's session so updates, deletes and rollbacks stay narrowed. - Session tag keys repeating regardless of case are refused (InvalidParameterValue), and tag merges run in key order. - AssumeRole honors Tags, TransitiveTagKeys, SourceIdentity and MaxSessionDuration; role chaining carries transitive tags and the source identity. - An unbundled AWS managed PolicyArns entry is accepted and not applied.
…ies, full-context session checks, presigned principals - An AWS managed session policy substrate does not bundle allows nothing instead of being dropped (follow-up #1712 vendors the documents). - When identity policies cannot be read, the session policy is decided through the same contexts and secondary passes as a resolved request. - AssumeRole re-checks the 50-tag limit on inherited plus passed tags and refuses a TransitiveTagKeys entry naming no tag; the federated assumes refuse the same. - Presigned URLs and S3 POST-policy uploads resolve their signer from X-Amz-Credential. - A CloudFormation creator's tags are its entity's own under its session's.
scttfrdmn
force-pushed
the
feat/v0134-federation
branch
from
November 25, 2026 01:16
a469592 to
de10810
Compare
4 tasks
…credentials only without signature verification; case-insensitive transitive tag keys Under VerifySignatures only a SigV4 Authorization header names the caller, since nothing else is verified; verifying the other forms is #1713. With verification off, SigV2 headers and AWSAccessKeyId query and form fields resolve their signer too. TransitiveTagKeys match tags regardless of case in AssumeRole chaining and federated claims; the SAML refusal says assertion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1706
Part of #1613. This is the STS/IAM federation slice. Still open in #1613:
ListEntitiesForPolicy,UpdateUser/UpdateGroup(#1582) and login profiles (#1583), all in the follow-up PRfeat/v0134-iam-extras.GetFederationTokenis #1694 (v0.137.0).UpdateOpenIDConnectProviderThumbprint, Add/RemoveClientID and Tag/Untag/ListTags. The ARN isoidc-provider/<url without https://>, andGetreportsUrlwithout its scheme, as the API reference's sample does.EntityAlreadyExists/409. More than 5 thumbprints or 100 client IDs isLimitExceeded/409.NoSuchEntity/404. The Delete page declares that error and makes no idempotency statement, so I did not follow the brief's assumption here.ThumbprintListstores none, andOpenIdIdpCommunicationErroris reachable only throughPOST/DELETE /v1/iam/oidc-provider-outcome(keyed by URL or*).validUntilonly.SAMLProviderUUIDis minted. Only private-key IDs are stored, never the key text.iam_state_keys.go.Url/Name. Tags are read foraws:ResourceTag. The citation test checks each row against the vendored Service Reference.GetAccountAuthorizationDetailsnow acceptsFilter=SAMLProviderList. It selects no population, because the response has no member that could carry a provider.AssumeRoleWithWebIdentity/AssumeRoleWithSAML(sts_federation.go), following decision 2: claims are checked, the rest is seeded.parser.goresolves an unsigned request that has no other signal and carriesAction=AssumeRoleWith*tosts. The AWS CLI against a built binary now works, where it used to getServiceNotAvailable.issmust name a provider in the role's account. Otherwise the call answersInvalidIdentityToken"No OpenIDConnect provider found in your account for …".audmust be inClientIDList, else "Incorrect token audience".expis checked against the simulated clock. A token past it answersExpiredTokenException"Token expired: current date/time N must be before the expiration date/time M".PrincipalArnmust exist.Roleattribute must pair the role and the provider, in either order.NameIDand aRoleSessionNamemust be present.NotOnOrAfteris checked against the simulated clock.SessionNotOnOrAftercaps the session.stsTrustDecisionevaluates the role's policy with the provider ARN as the principal, forsts:AssumeRoleWithWebIdentityorsts:AssumeRoleWithSAML.principalCoverednow skips"AWS"entries for a provider ARN, so only aFederatedentry admits one. Before this,"AWS": "<account>"would have matched by account.<host/path>:sub,:aud(azpwhen present),:oaud,:email,:amr(multivalued) andsts:RoleSessionName. SAML getssaml:aud(the Recipient),saml:iss,saml:sub,saml:sub_type,saml:docandsaml:namequalifier.AccessDenied/403 "Not authorized to perform sts:AssumeRoleWith…".POST/DELETE /v1/sts/federation-outcomeis registered in the recorded control-plane group.{provider|"*", error, message?, count?}, whereerrorisInvalidIdentityToken,IDPRejectedClaimorIDPCommunicationError.IDPCommunicationErrorapplies to web identity only, the one operation that documents it.countcounts down per assume, so a retry loop can be shown failing and then succeeding.mintRoleSessionis shared withAssumeRole. It mints anASIA…key and theassumed-role/<role>/<session>ARN, andrecordRoleLastUsedstamps the role. Responses carrySubjectFromWebIdentityToken,AudienceandProvider(the token'siss, per the page), orSubject,SubjectType,Issuer,AudienceandNameQualifier(AWS's SHA-1 formula).AWS::IAM::OIDCProviderandAWS::IAM::SAMLProviderhave deploy, update-in-place and delete rows.UrlandNameare Replacement.Ref/GetAtt Arngive the ARN, and SAML also exposesGetAtt SamlProviderUUID.docs/reference/iam.mdgains 18 rows, an "Identity providers" section and the CFN rows.docs/reference/sts.mdgains two rows and "Federated assumes check claims, not signatures". The stale paragraphs (no federated assume,SAMLProviderListrefused) are fixed.The routed-operation catalog goes from 1,128 to 1,148 (IAM 79 → 97, STS 3 → 5). The wire-model snapshot was refetched for the new operations.
Provenance
Observed rather than published: the OIDC
EntityAlreadyExists("Provider with url … already exists.") andNoSuchEntity("OpenIDConnect Provider not found for arn …") wording; the web-identity "No OpenIDConnect provider found…", "Incorrect token audience", "Token expired: …", "Not authorized to perform sts:AssumeRoleWithWebIdentity" and the thumbprint-mismatchInvalidIdentityToken. Each matches the AWS CLI's and Terraform's reported output. The SAML refusals ("RoleSessionName is required in AuthnResponse", "Not authorized to perform sts:AssumeRoleWithSAML", "Response signature invalid", "Specified provider doesn't exist.") are documented in the IAM SAML troubleshooting guide. That guide gives no code for the last one, soInvalidIdentityTokenthere is substrate's choice. The rest are substrate's own and say so in the CHANGELOG.Gates run locally
make lint(0 issues),make testandmake e2e.operation-catalog-check,docs-reference-check,docs-headings-check,operation-docs-check,authz-reference-check,cfn-schema-check,wire-model-check,scheduler-query-model-check,doc-links-check.wire-bookkeeping-check,discarded-*,nondeterminism-check,comment-history-check, plusdocs-versionsanddocs-counts-check.SUBSTRATE_IAC=1 make iac-e2e: Terraform and CDK journeys pass.node_modulesremoved afterwards.make test,TestSQS_ReceiveMessage_SystemAttributesfailed once: a wall-clock-dependent timestamp was 3 ms off. That is pre-existing and passes on rerun.aws_iam_openid_connect_providerresources (GitHub, EKS) plus anaws_iam_rolewhoseassume_role_policytrusts one. Apply succeeded, the secondplan -detailed-exitcodewas empty (exit 0), destroy succeeded, and the server log had no warnings. The AWS CLI'ssts assume-role-with-web-identity(unsigned) then returned credentials for a matchingsubandAccessDeniedfor a non-matching one.Review rounds
First round.
MaxSessionDurationis enforced.SourceIdentityare honored, gated onsts:TagSession/sts:SetSourceIdentity.entityID, and its audience must be AWS's.nbf/NotBeforeare checked. A token with nosubis refused, and SAMLSessionDurationis no longer the API default.Second round.
AssumeRolehonorsTags,TransitiveTagKeys,SourceIdentityandMaxSessionDuration, and role chaining carries them (sts: AssumeRole ignores Tags, TransitiveTagKeys and SourceIdentity, and does not check MaxSessionDuration #1706).