A project on Amazon Linux failed a security review. You are reviewing a CodeBuild buildspec.yaml and must recommend security improvements. Which changes follow AWS best practices? (Choose three.)
Choose an answer
Tap an option to check your answer.
Correct answer: Grant the CodeBuild project’s IAM service role the necessary permissions and remove any AWS credentials stored in environment variables., Store DB_PASSWORD as a SecureString in AWS Systems Manager Parameter Store and remove the DB_PASSWORD from the build environment variables., Use AWS Systems Manager Run Command instead of using scp and ssh within the build to interact with instances..
Why this is the answer
Storing AWS credentials directly in environment variables is a security risk; granting the CodeBuild project's IAM service role only the necessary permissions adheres to the principle of least privilege and is the recommended practice. Storing sensitive information like DBPASSWORD as a SecureString in AWS Systems Manager Parameter Store is a secure method for managing secrets, preventing their exposure in build logs or configuration files. Using AWS Systems Manager Run Command for interacting with instances is more secure than scp and ssh because it operates without opening inbound ports, provides detailed logging, and integrates with IAM for fine-grained access control. Deleting temporary files is good practice but doesn't prevent access by other CodeBuild users if the container is reused or its image is compromised. Storing environment variables in S3 and then downloading them is less secure than Parameter Store for sensitive data. Obfuscating environment variables is not a secure alternative to proper secrets management and can be easily reversed.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed