AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 24

A security review has identified that an AWS CodeBuild project is downloading a database population script from an Amazon S3 bucket using an unauthenticated request. The security team does not allow unauthenticated requests to S3 buckets for this project.
How can this issue be corrected in the MOST secure manner?

Answer options

Correct answer: C

Explanation

The correct answer is C because it ensures that unauthenticated access is removed through a bucket policy and grants the necessary permissions to the CodeBuild project's service role. This approach adheres to security best practices by using IAM roles, while the other options either introduce less secure methods or do not address the primary issue of unauthorized access correctly.