exam questions

Exam AWS Certified Security - Specialty All Questions

View all questions & answers for the AWS Certified Security - Specialty exam

Exam AWS Certified Security - Specialty topic 1 question 185 discussion

Exam question from Amazon's AWS Certified Security - Specialty
Question #: 185
Topic #: 1
[All AWS Certified Security - Specialty Questions]

A company's Security Engineer is copying all application logs to centralized Amazon S3 buckets. Currently, each of the company's application is in its own AWS account, and logs are pushed into S3 buckets associated with each account. The Engineer will deploy an AWS Lambda function into each account that copies the relevant log files to the centralized S3 bucket.
The Security Engineer is unable to access the log files in the centralized S3 bucket. The Engineer's IAM user policy from the centralized account looks like this:

The centralized S3 bucket policy looks like this:

Why is the Security Engineer unable to access the log files?

  • A. The S3 bucket policy does not explicitly allow the Security Engineer access to the objects in the bucket.
  • B. The object ACLs are not being updated to allow the users within the centralized account to access the objects.
  • C. The Security Engineer's IAM policy does not grant permissions to read objects in the S3 bucket.
  • D. The s3:PutObject and s3:PutObjectAcl permissions should be applied at the S3 bucket level.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
trongod05
Highly Voted 3 years ago
Selected Answer: B
I think it is B for these reasons: 1. Both the bucket and user are in the same account. It says in the question that the Security Engineer's account is defined in the centralized account. The bucket policy is also in the centralized account. So we are not assuming any roles that would apply to the answer. 2. You have to look at all applicable policies and evaluate together. We start with an explicit deny. Then we look at IAM, there is an explicit allow for the Security Engineer for s3:Get and s3:List. Then we look at bucket policy. There's no explicit deny's there and we still have the explicit allow being applied. Finally, we look at bucket ACL. Since it isn't presented in the question, we can only assume that there is an ACL that explicitly denies any principal's other than the ones listed in the ACL.
upvoted 10 times
...
Raphaello
Most Recent 1 year, 4 months ago
Selected Answer: B
Object ACL. (s3:x-amz-acl | s3:x-amz-grant-read | s3:x-amz-grant-full-control)
upvoted 1 times
...
Raphaello
1 year, 4 months ago
Selected Answer: A
Best practice is to set bucket policy to control cross-account access to S3 bucket. A is the correct answer.
upvoted 1 times
Raphaello
1 year, 4 months ago
Not sure how I missed "The Engineer's IAM user policy from the CENTRALIZED account looks like this". It is not cross-account access. Therefore, B is the right answer. My mistake.
upvoted 1 times
...
...
addy_prepare
1 year, 10 months ago
Selected Answer: A
A - "It's also a best practice to use IAM policies and bucket policies (instead of ACLs) to manage cross-account access to buckets and objects." As well as it said that ACL is used for specific cases https://repost.aws/knowledge-center/cross-account-access-s3
upvoted 2 times
...
BlissfulCheetah
2 years ago
Looks to me like A is the answer. When applying both IAM and S3 bucket policies, the resultant policy will be the intersection of both. The IAM policy grants the engineer get access, but the bucket policy's default deny policy doesn't grant access to anyone. Only the "logcopier" role and the IAM user that created the bucket can access the bucket. https://aws.amazon.com/blogs/security/iam-policies-and-bucket-policies-and-acls-oh-my-controlling-access-to-s3-resources/ S3 bucket policies (as the name would imply) only control access to S3 resources, whereas IAM policies can specify nearly any AWS action. One of the neat things about AWS is that you can actually apply both IAM policies and S3 bucket policies simultaneously, with the ultimate authorization being the least-privilege union of all the permissions (more on this in the section below titled “How does authorization work with multiple access control mechanisms?”).
upvoted 2 times
...
TerrenceC
2 years, 6 months ago
Another useful material for demystification. https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-auth-workflow-object-operation.html
upvoted 1 times
...
sapien45
2 years, 10 months ago
Selected Answer: B
Why can't I access an object that was uploaded to my Amazon S3 bucket by another AWS account? For existing Amazon S3 buckets with the default object ownership settings, the object owner is the AWS account which uploaded the object to the bucket. For these existing buckets, an object owner had to explicitly grant permissions to an object (by attaching an access control list). https://aws.amazon.com/premiumsupport/knowledge-center/s3-bucket-owner-access/ With S3 Object Ownership, bucket owners can now manage the ownership of any objects uploaded to their buckets. By default, all newly created S3 buckets have the bucket owner enforced setting enabled.
upvoted 1 times
...
tinyflame
3 years, 6 months ago
Answer = A / Multi-account requires both IAM and bucket policy permissions
upvoted 1 times
...
wahlbergusa
3 years, 8 months ago
It is B.
upvoted 2 times
...
nainakaexam
3 years, 8 months ago
I think it's A
upvoted 2 times
nainakaexam
3 years, 8 months ago
"A" would make sense if the centralised S3 bucket is in a different cross account for security engineer. From the question, it's not quite clear if it's actually a cross account
upvoted 1 times
nainakaexam
3 years, 8 months ago
It's B, it's clear to me now. Disregard my previous comment. https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html#example-bucket-policies-use-case-8
upvoted 1 times
...
...
...
DerekKey
3 years, 8 months ago
I think A To allow cross-account access, you attach a resource-based policy to the resource that you want to share. You must also attach an identity-based policy to the identity that acts the principal in the request. The resource-based policy in the trusting account must specify the principal of the trusted account that will have access to the resource. You can specify the entire account or its IAM users, federated users, IAM roles, or assumed-role sessions.
upvoted 2 times
...
rhinozD
3 years, 8 months ago
I think its B A: no need to explicit allow IAM user. Either IAM policy or bucket policy allows the principal is enough. In this case, there is no explicit deny B: you can deny bucket owner account to access bucket/object via ACLs C: S3:Get* and S3:List* are allowed already in IAM policy D: User just need to read.
upvoted 3 times
thuyeinaung
2 years, 8 months ago
S3:Get* and S3:List* are NOT allowed in IAM policy
upvoted 1 times
...
thuyeinaung
2 years, 8 months ago
sorry, I was misread
upvoted 1 times
...
...
Haz56
3 years, 8 months ago
Cant be B, as the user and bucket are in the same centralised account "Use ACLs to control which principals in other accounts can access the resource to which the ACL is attached. ACLs are similar to resource-based policies, although they are the only policy type that does not use the JSON policy document structure. ACLs are cross-account permissions policies that grant permissions to the specified principal. ACLs cannot grant permissions to entities within the same account." https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html
upvoted 1 times
...
Daniel76
3 years, 8 months ago
My view is B. https://aws.amazon.com/blogs/security/iam-policies-and-bucket-policies-and-acls-oh-my-controlling-access-to-s3-resources/ "Whenever an AWS principal issues a request to S3, the authorization decision depends on the union of all the IAM policies, S3 bucket policies, and S3 ACLs that apply." A- S3 bucket does not need to explicitly allow. There is no explicit deny either. C- S3:Get* and S3:List* are allowed. D- The required access by security engineer is read, so S3:Put* are irrelevant. Also, the level of the Resource given should be acceptable.
upvoted 2 times
...
sanjaym
3 years, 8 months ago
A for sure. Security Engineer has read permission by IAM policy but bucket policy not allowing Engineer to get objects from bucket.
upvoted 3 times
...
disposable1989
3 years, 9 months ago
yeah, B For the people that think it's a, it's not. the IAM policy allows to get object, but not PUT bucket policy allows put from some roles. there's no deny anywhere, both policies even evaluated together do not deny the engineer to read.
upvoted 2 times
...
disposable1989
3 years, 9 months ago
yeah, B For the people that think it's a, it's not. the IAM policy allows to get object, but not but bucket policy allows put from some roles. there's no deny anywhere, both policies even evaluated together do not deny the engineer.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...