AWS Certified Solutions Architect – Professional (SAP-C02) — Question 271

During an audit, a security team discovered that a development team was putting IAM user secret access keys in their code and then committing it to an AWS CodeCommit repository. The security team wants to automatically find and remediate instances of this security vulnerability.

Which solution will ensure that the credentials are appropriately secured automatically?

Answer options

Correct answer: D

Explanation

Option D is correct because a CodeCommit trigger can immediately invoke an AWS Lambda function to scan new commits in near real-time, allowing the function to disable compromised IAM credentials instantly and notify the user. Option C is incorrect because Amazon Macie is designed to scan data in Amazon S3, not CodeCommit repositories. Options A and B introduce significant delays (nightly or scheduled scans) and fail to target the immediate risk of credentials committed to the repository.