You have an S3 bucket with a policy that explicitly denies any request where the source IP is not from your corporate network. What will happen if someone tries to access the bucket from outside your network?
Think about what a deny statement in a bucket policy does to requests that do not meet the condition.
A deny statement in a bucket policy overrides any allow. If the request comes from outside the allowed IP range, it is blocked and the user gets an access denied error.
Given an IAM user with ARN arn:aws:iam::123456789012:user/Alice, which bucket policy snippet correctly grants read-only access to the bucket example-bucket?
Read-only access means allowing only actions that retrieve objects, not modify or delete.
Option A allows the IAM user Alice to perform the s3:GetObject action on all objects in the bucket, which is read-only access. Other options either allow wrong actions or deny access.
You want to make only the public/ folder inside your S3 bucket my-bucket publicly readable, but keep the rest private. Which bucket policy achieves this?
Focus on granting access only to the objects inside the public/ folder.
Option C allows anyone to read objects only inside the public/ folder by specifying the resource ARN with the folder prefix. Other options either allow too much or deny incorrectly.
You have a bucket policy that denies all s3:DeleteObject actions unless the request includes MFA authentication. What happens if a delete request is made without MFA?
Consider how explicit deny statements affect requests.
An explicit deny in a bucket policy overrides any allow. Without MFA, the delete request is blocked even if the user has permissions.
You want to allow read-only access to your bucket secure-bucket for a specific AWS account 987654321098. Which bucket policy snippet follows the principle of least privilege?
Least privilege means granting only the exact permissions needed to the correct principal.
Option D grants only read object access to the entire account root principal, which is appropriate for cross-account read access. Option D is too open, A grants all actions, and D only allows listing but not reading objects.