Repository navigation
Closed
Labels
area: iamIssues relating to the iam componentarea: serverIssues relating to the server componenttype: featureNew feature or improvement
Milestone
Description
What
iam:UpdateAssumeRolePolicy is not implemented. CreateRole is the only operation that can set a role's trust policy, so once a role exists its AssumeRolePolicyDocument cannot be changed.
Found while fixing #593, which assumed the document was "stored by CreateRole/UpdateAssumeRolePolicy" — the second half does not exist in the IAM operation switch.
Why it matters now
Before #593 this was invisible: nothing read the trust policy, so being unable to change it cost nothing. Now that AssumeRole evaluates it, the document is load-bearing and a consumer cannot correct or tighten one after creation. Two shapes this blocks:
- IaC that creates a role and then narrows its trust policy in a second pass — a common CDK/Terraform update-in-place pattern; a test replaying that update silently keeps the original policy, so the tightening it is meant to verify is unobservable.
- A test wanting to prove both halves of a confused-deputy gate on one role (assume with the ExternalId, tighten to another account, assume again and expect a denial) currently has to create two roles, which is not what the code under test does.
Acceptance criteria
-
UpdateAssumeRolePolicyacceptsRoleName+PolicyDocument, replaces the storedAssumeRolePolicyDocument, and returns the empty response shape (UpdateAssumeRolePolicyResponsewith onlyResponseMetadata). -
NoSuchEntityfor an unknown role, with the message AWS uses. -
MalformedPolicyDocumentfor a document that does not parse, matching howcreateRolevalidates today. - Read-back through
GetRolereflects the new document, URL-decoded consistently withCreateRole's storage. - The new document takes effect on the next
AssumeRole— a test that assumes successfully, tightens the policy to another account, and assumes again expectingAccessDenied(the STS: AssumeRole does not evaluate the role's trust policy, so no ExternalId or Principal condition is enforced #593 gate, exercised through an update rather than a second role). - Existing sessions minted under the old policy are unaffected; AWS does not revoke them, and substrate should not either.
-
docs/services.mdrow added (regenerate withmake docs-reference); CHANGELOG entry under Added.
Verify request/response shape and error codes against the UpdateAssumeRolePolicy API reference rather than assumption.
Metadata
Metadata
Assignees
Labels
area: iamIssues relating to the iam componentarea: serverIssues relating to the server componenttype: featureNew feature or improvement
Activity
scttfrdmn commentedon Aug 9, 2026
Milestoned v0.96.0, alongside #595.
Confirmed the report against
main(d905e92, v0.95.0):grep -rn UpdateAssumeRolePolicy emulator/returns zero matches — the operation is absent from the IAM switch entirely, so it currently falls through toInvalidAction.The pattern to mirror
createRoleatiam_plugin.go:392-397is the existing shape for this, and following it answers two of the acceptance criteria directly:Two details worth carrying across rather than rediscovering:
iam_types.go:38declaresAssumeRolePolicyDocument PolicyDocument, so the update unmarshals into the same type and the "URL-decoded consistently withCreateRole's storage" criterion is satisfied by reusing this path rather than by adding a decode step.PolicyDocumentis what STS: AssumeRole does not evaluate the role's trust policy, so no ExternalId or Principal condition is enforced #593's gate reads, so an update that stores through this type takes effect on the nextAssumeRolewith no further wiring — which is what makes the tighten-then-deny test in the criteria straightforward to write.Unlike
CreateRole,PolicyDocumentis required onUpdateAssumeRolePolicy, so an absent one isMissingParameter/400 rather than an empty document — worth pinning, since thecreateRolecode above treats empty as legitimate.feat(iam): implement UpdateAssumeRolePolicy (#594) (#600)