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

A company has developed a serverless web application that is hosted on AWS. The application consists of Amazon S3. Amazon API Gateway, several AWS Lambda functions, and an Amazon RDS for MySQL database. The company is using AWS CodeCommit to store the source code. The source code is a combination of AWS Serverless Application Model (AWS SAM) templates and Python code.
A security audit and penetration test reveal that user names and passwords for authentication to the database are hardcoded within CodeCommit repositories. A DevOps engineer must implement a solution to automatically detect and prevent hardcoded secrets.
What is the MOST secure solution that meets these requirements?

Answer options

Correct answer: B

Explanation

Option B is the most secure solution as it utilizes Amazon CodeGuru Reviewer to automatically detect hardcoded secrets and recommends using AWS Secrets Manager for storing sensitive information securely. Other options, while they provide some level of security, either involve manual reviews or suggest less secure storage methods, such as Parameter Store in a non-secure string format.