Files
floci/src/test/java
Priamo Germosen fad1093175 fix(s3): name the caller and the policy that refused it in S3's access denied message (#9281)
S3 answered a refused request with "User is not authorized to perform:
s3:GetObject", while the CloudTrail data event recorded a message of
its own that named the access key as the user (user/AKIA...) and always
gave "no identity-based policy allows" as the reason, even for an
explicit deny. A copy's source, a presigned POST and the other
resources a service checks apart from the request were refused with
that same message.

S3's guide says a refusal within the bucket's account or organization
names the caller, the resource and the type of policy that refused it,
that CloudTrail logs the same context, and that a request from outside
the organization gets "Access Denied" alone. Both refusals now build
the message as the other refusals in IamEnforcementFilter do: the
caller's ARN and the reason firstRefusal gives, or a bucket policy's
explicit deny, through AccessDeniedMessages.notAuthorized. S3 answers
with it and CloudTrail records it, and a caller from another
organization is told "Access Denied", judged on the bucket's owner as
the decision resolves it, since a presigned POST names none. S3 Control
keeps its own envelope
and wording. The resources Redshift, Secrets Manager and SSM check
apart from the request name the caller the same way.

CloudTrailLogFiles also reads through a signing filter, for a test
where S3 checks signatures.
2026-11-23 12:25:43 -04:00
..