Exam SAP-C01 All QuestionsBrowse all questions from this exam
Question 19

The following policy can be attached to an IAM group. It lets an IAM user in that group access a "home directory" in AWS S3 that matches their user name using the console.

{

"Version": "2012-10-17",

"Statement": [

{

"Action": ["s3:*"],

"Effect": "Allow",

"Resource": ["arn:aws:s3:::bucket-name"],

"Condition":{"StringLike":{"s3:prefix":["home/${aws:username}/*"]}}

},

{

"Action":["s3:*"],

"Effect":"Allow",

"Resource": ["arn:aws:s3:::bucket-name/home/${aws:username}/*"]

}

]

}

    Correct Answer: B

    The given IAM policy allows users to perform S3 actions within their own 'home directory' but is missing permissions necessary for using the console effectively. Specifically, it lacks permissions for listing all buckets (ListAllMyBuckets) and obtaining bucket locations (GetBucketLocation). These actions are required for a user to navigate to their 'home directory' using the AWS S3 console. Without these permissions, users will receive access denied errors when attempting to use the console to access their specific directories.

Discussion
Moon

Answer B: explanation: https://aws.amazon.com/blogs/security/writing-iam-policies-grant-access-to-user-specific-folders-in-an-amazon-s3-bucket/

sarah1

I thought this link was super helpful. Here's a quote: "The ListAllMyBuckets action grants David permission to list all the buckets in the AWS account, which is required for navigating to buckets in the Amazon S3 console (and as an aside, you currently can’t selectively filter out certain buckets, so users must have permission to list all buckets for console access). The console also does a GetBucketLocation call when users initially navigate to the Amazon S3 console, which is why David also requires permission for that action. Without these two actions, David will get an access denied error in the console."

FAB1975

Thank you Sarah. Really good and concise summary: Is missing: List on resource: all buckets GetBucketLocation on resource: all buckets

fw

The link indeed is very helpful. It shows how to configure policies so that user can use console to upload/download objects from S3 to his own directory. Basically two more blocks are needed (in addition to two blocks listed in this question): Block 1: Allow required Amazon S3 console permissions Block 2: Allow listing objects in root and home folders

nitinz

that ink is super helpful, many config are missing from it, hence B

cldy

"s:*" covers everything, so the correct answer is A TRUE.

tan9

User has no permission to list the ancestor directories, so that they won't be possible to navigate into their own home directory. And full working policy can be found at: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_s3_home-directory-console.html

Musk

But if they type the right URL they get in. I don't see why it would not work. The question is not whether the user can navigate down to the right path. I think it's TRUE

fullaws

B is correct (s3:ListAllMyBuckets, s3:GetBucketLocation need to Resource *)

awssp12345

Should s3:* cover all the s3 permissions including list?

amog

Answer is B "using the console.". They can use this policy to access home directory by URL, but not the console

01037

B. "Using the console" is the key. If only program access is needed, then it's enough.

noisonnoiton

go with B

BillyC

Yes B is Correct!

Narendragpt

A is True .

SkyZeroZxOption: B

Answer B: explanation: https://aws.amazon.com/blogs/security/writing-iam-policies-grant-access-to-user-specific-folders-in-an-amazon-s3-bucket/

sjpd10

The second action provides access to all S3 buckets unlike the first with a 'Condition'

roka_uaOption: B

Vote B

tkanmani76

Answer A - In the same link being discussed here the last block is as below - which provides * for all S3 Actions and take to his home page. { "Sid": "AllowAllS3ActionsInUserFolder", "Action":["s3:*"], "Effect":"Allow", "Resource": ["arn:aws:s3:::my-company/home/${aws:username}/*"] }

RVivek

It still gives permission only to "my-company/home/${aws:username}/*" , Permission to list all buckets is necessary to navigate to this folder

tkanmani76

Agree, stand corrected - Option B

cldy

A. Shouldn't s:* cover all S3 actions?

shammous

The issue here is not with the action, but with which resource is applied. In our case, it's applied to the folder's content, not the folder itself.

srknbngl

Correct Answer: B

Danao

Missing quite a few configs, like console access, root and home folder access, etc

Tamili

False because either one should be present. Both satisfy the requirement