Files
floci/src/main/java
TATSUNO “Taz” Yasuhiro 701b04c410 feat(lambdaweb): reject resource policies whose principal does not exist (#6769)
* feat(lambdaweb): reject resource policies whose principal does not exist

PutResourcePolicy now looks up every AWS principal a policy names, as Lambda
does before it stores the policy. A role or user ARN has to name one IAM
holds in that account, under its own path, and a unique id one in the
function's account. A missing principal, an assumed-role session, a
CanonicalUser or an ARN in another partition gets the invalid principal
message, and a role or user named under another path gets the message
that the ARN does not match the actual one.

The principals are looked up after every statement passes its other
checks and before any statement is refused as public, which is the order
AWS checks them in.

* docs(lambdaweb): drop the principal check from the items not implemented yet

* refactor(lambdaweb): find policy principals through IamService and the resolver's partition

IamService.heldPrincipalArn now gives the ARN IAM holds what a principal
ARN names under, the root as given or the role or user at its own path.
DSQL's principal check and Lambda Web's use it, and Lambda Web keeps only
the path comparison and its messages. Lambda Web takes the partition from
RegionResolver.partitionForRegion, so a custom region falls back to the
deployment's partition.
2026-10-27 22:00:28 -04:00
..