SCS-C02 · Question #171
A developer operations team uses AWS Identity and Access Management (IAM) to manage user permissions. The team created an Amazon EC2 instance profile role that uses an AWS managed ReadOnlyAccess…
The correct answer is C. Attach an inline policy with kms:Decrypt permissions to the IAM role. Option C is correct because the S3 bucket is KMS-encrypted, and reading encrypted objects requires both S3 read permissions and kms:Decrypt on the KMS key - the existing ReadOnlyAccess policy covers S3 reads but not KMS decryption. Attaching an inline policy with kms:Decrypt to…
Question
A developer operations team uses AWS Identity and Access Management (IAM) to manage user permissions. The team created an Amazon EC2 instance profile role that uses an AWS managed ReadOnlyAccess policy. When an application that is running on Amazon EC2 tries to read a file from an encrypted Amazon S3 bucket, the application receives an AccessDenied error. The team administrator has verified that the S3 bucket policy allows everyone in the account to access the S3 bucket. There is no object ACL that is attached to the file. What should the administrator do to fix the IAM access issue?
Options
- AEdit the ReadOnlyAccess policy to add kms:Decrypt actions
- BAdd the EC2 IAM role as the authorized Principal to the S3 bucket policy
- CAttach an inline policy with kms:Decrypt permissions to the IAM role
- DAttach an inline policy with S3:* permissions to the IAM role
How the community answered
(29 responses)- A10% (3)
- B3% (1)
- C83% (24)
- D3% (1)
Explanation
Option C is correct because the S3 bucket is KMS-encrypted, and reading encrypted objects requires both S3 read permissions and kms:Decrypt on the KMS key - the existing ReadOnlyAccess policy covers S3 reads but not KMS decryption. Attaching an inline policy with kms:Decrypt to the EC2 IAM role grants exactly the missing permission without over-provisioning.
Why the others are wrong:
- A - AWS managed policies are read-only; you cannot edit them directly. You must extend permissions via separate attached policies.
- B - The bucket policy already allows all account principals, so adding the role as an explicit principal changes nothing; the real gap is the missing KMS permission.
- D -
S3:*is unnecessary over-provisioning sinceReadOnlyAccessalready includes S3 read rights, and it still doesn't solve the KMS decryption problem.
Memory tip: Whenever you see "encrypted S3" + AccessDenied, immediately think KMS. The formula is: S3 read + kms:Decrypt = access to encrypted objects. If one half is missing, access is denied - and you fix it by adding a new policy, never by editing an AWS managed one.
Topics
Community Discussion
No community discussion yet for this question.