A role's identity policy allows s3:GetObject on a bucket in the same account. The bucket policy denies s3:GetObject to all principals with a StringNotEquals condition on aws:SourceVpce for vpce-1a2b3c4d. The role calls GetObject from an on-premises network over the internet, not through any VPC endpoint. What is the result?
Show the answer
Correct answerA. Denied, because the explicit Deny applies and overrides the identity policy's Allow.
AWhy this is right: The Deny matches because the endpoint key is missing, and an explicit Deny overrides any Allow.
BWhy not this: Negated condition operators such as StringNotEquals evaluate to true when the key is absent, so the Deny still matches.
CWhy not this: Identity and resource policies are evaluated together; neither takes precedence over an explicit Deny.
DWhy not this: In the same account an identity policy Allow is sufficient; the failure comes from the explicit Deny.
A request that does not use a VPC endpoint has no aws:SourceVpce value, and a negated operator such as StringNotEquals evaluates to true when the key is missing, so the Deny applies. An applicable explicit Deny overrides every Allow. Within one account, an identity policy Allow alone would otherwise be enough, so the missing bucket-policy Allow is not the cause.