Files
floci/docs/services
Priamo Germosen 2b372cc0fc fix(iam): apply the permissions boundary a delegation registers (#8465)
A delegation request's RolePermissionRestrictionArns was stored, echoed and
counted, and nothing applied it, so a role created with delegated credentials
carried no boundary where AWS forces one. The partner guide says long-term
permissions "limit the permissions of any roles that are created or managed
through temporary access" and are "implemented as IAM permissions boundaries",
so a partner's cap did not reach the roles it exists to cap.

The member is also not an input. It is absent from CreateDelegationRequest and
appears only in the DelegationRequest output shape, where
GetDelegationRequest's own example reports it empty, because AWS fills it from
the partner's registration rather than from a request. Those boundaries are
registered by emailing AWS, with no API at all, under ARNs shaped
arn:aws:iam::partner:policy/permission_boundary/<partner_domain>/<policy_name>_<date>,
which carry the word partner where an account id goes. So no caller can create
one, no account holds one, and the only way this emulator can hold what AWS
holds out of band is to be handed it.

It is handed it by configuration. services.iam.partner-permission-boundaries-path
names a JSON file of partner account id to an object of boundary ARN to policy
document, which is the shape of the registration it stands in for. Unset, which
is the default, registers nothing: a request reports no restriction, a role
created with delegated credentials carries only the boundary its call asks for,
and nothing moves for a deployment that configures no file. A file that cannot
be read registers nothing rather than failing startup, an unreadable
registration being the same situation as a partner that never onboarded.

From there the chain is the one the guide describes. A request a registered
partner files reports those ARNs on itself, GetDelegatedAccessToken carries them
onto the delegated session, and CreateRole with that session takes one as the
role's boundary. The session is minted in the partner's account and used in the
customer's, so the lookup spans accounts, which is what findSessionAnyAccount is
for.

A registered document is read as a boundary and as nothing else. One reader
answers a boundary ARN, taking the registration ahead of the store, so GetPolicy
does not answer these ARNs, no Attach call can attach one as an identity policy,
no list reports one, and a policy stored under the same ARN cannot shadow the
cap. Every write that sets a boundary accepts a registered ARN without requiring
it as a policy of the account, the create and the two puts alike, so one ARN
behaves the same way wherever a boundary is set.

The cap also stays where it was put. The credentials a delegation issued cannot
replace or remove the boundary they gave a role, since the guide limits roles
"created or managed through temporary access" and the registration is immutable,
and iam:PermissionsBoundary publishes the boundary the write will apply rather
than the one the call asked for, so a policy conditioned on it is told the value
the role ends up with. Both refusal and reading are this emulator's own, no
source wording either.

A stack's roles are capped too. CloudFormation provisions after the request
returns, on a background executor, so the caller cannot be read when the role is
created and the cap travels with the stack instead: CreateStack and UpdateStack
record the boundary the caller's delegation registers, the dispatcher puts it in
the provisioning context, and the role provisioner prefers it to the template's
PermissionsBoundary, the same precedence a direct CreateRole has. An update
records it as well, the guide capping roles "created or managed through temporary
access". Every existing caller of the context and the dispatcher keeps its
signature, the new component and overload defaulting to no cap.

Two readings here are this emulator's own, both documented. A delegation's cap
beats a PermissionsBoundary the CreateRole call names, since the cap is what the
customer registered rather than a choice of the caller. And where a request
names several boundaries, the first is applied, a role carrying one. Only a
boundary still registered is applied, so a request stored before the
registration changed cannot bound a role by a document nobody can read.

Nothing new is refused and no code or status moves: with no registration the
behaviour is what it was, and with one the role simply carries the boundary AWS
would have given it.
2026-11-15 17:43:55 -04:00
..
2026-08-21 00:09:04 -04:00