AWS Certified Solutions Architect – Professional — Question 243
During a security audit of a Service team's application, a Solutions Architect discovers that a username and password for an Amazon RDS database and a set of
AWS IAM user credentials can be viewed in the AWS Lambda function code. The Lambda function uses the username and password to run queries on the database, and it uses the IAM credentials to call AWS services in a separate management account.
The Solutions Architect is concerned that the credentials could grant inappropriate access to anyone who can view the Lambda code. The management account and the Service team's account are in separate AWS Organizations organizational units (OUs).
Which combination of changes should the Solutions Architect make to improve the solution's security? (Choose two.)
Answer options
- A. Configure Lambda to assume a role in the management account with appropriate access to AWS.
- B. Configure Lambda to use the stored database credentials in AWS Secrets Manager and enable automatic rotation.
- C. Create a Lambda function to rotate the credentials every hour by deploying a new Lambda version with the updated credentials.
- D. Use an SCP on the management account's OU to prevent IAM users from accessing resources in the Service team's account.
- E. Enable AWS Shield Advanced on the management account to shield sensitive resources from unauthorized IAM access.
Correct answer: B, D
Explanation
Option B is correct because using AWS Secrets Manager to manage database credentials enhances security by keeping sensitive information out of the source code and enabling automatic rotation. Option D is also correct as it helps to enforce access controls between the Service team's account and the management account, reducing the risk of unauthorized access. Options A, C, and E do not adequately address the core issue of exposing sensitive credentials within the Lambda code.