Files
floci/docs/services
Priamo Germosen 2e1f9d2ffc feat(iam): build access denied messages from the decision record (#9964)
The last step of #7887. A request a policy refused was answered with
"User is not authorized to perform: <action>" for every service but S3,
and the services that did name the policy type (S3, Athena's statements,
Lambda's network connectors) asked a second path, firstRefusal, which
re-ran the evaluation one policy type at a time.

The evaluator's DecisionRecord now carries the refusal an access denied
message names, worked out in the same decide() pass: the first policy
type that refuses, by its explicit deny or the allow it lacks, in the
order AWS was recorded naming them for lambda:PassNetworkConnector
(#6699): organization levels, identity policies, permissions boundary,
session policy. A resource policy's explicit deny comes first and its
missing allow across accounts last, as S3 names them (#9281). The SCP walk
keeps the first level that refuses.

AccessDeniedMessages.reason builds the phrase from that refusal, naming
the managed policy that holds the denying statement, or the boundary, by
its ARN. firstRefusal is gone. The enforcement filter explains each
decision instead of only evaluating it, and every policy refusal now
answers in the IAM User Guide's format, "User: <caller> is not
authorized to perform: <action> on resource: <resource> because no
identity-based policy allows the <action> action", in each protocol's
envelope. Refusals no policy made keep the old sentence.

Closes #7887
2026-12-01 23:49:10 -04:00
..