A security architect is designing an access and credentials management solution for a multi-account AWS environment. An application running on Amazon EC2 instances in Account A () must securely retrieve database credentials to connect to a PostgreSQL database in Account B (). The database credentials must be rotated every days without causing application downtime. The solution must adhere to the principle of least privilege, avoid long-term credentials, and ensure all data in transit and at rest is secured using customer-managed keys (CMKs). Which architecture represents the most secure and compliant design that meets these requirements?
- AStore the database credentials in Systems Manager Parameter Store as a standard String parameter in Account A. Attach an IAM role to the EC2 instances in Account A to retrieve the parameter value. Configure a scheduled AWS Lambda function in Account B running under administrative root user privileges to update the database password and write the new value back to Parameter Store in Account A.
- BCreate individual IAM users in Account B with long-term access keys for each EC2 instance in Account A. Store these credentials in AWS Secrets Manager in Account B, and write a custom script on the EC2 instances to retrieve the database credentials using the IAM users' access keys, bypassing federation to simplify cross-account authentication.
- Store the credentials in AWS Secrets Manager in Account B, encrypted with a customer-managed KMS key. Attach an IAM role to the EC2 instances in Account A, and configure the Secrets Manager resource policy and the KMS key policy in Account B to permit the Account A role to retrieve the secret and decrypt using the KMS key. Configure automatic rotation in Secrets Manager using a Lambda function in Account B.Cevap
- DStore the credentials in AWS Secrets Manager in Account B. Attach an IAM role to the EC2 instances in Account A and configure the Secrets Manager resource policy to allow access. Enable AWS KMS automatic key rotation on the customer-managed key in Account B, which will automatically rotate the database password and re-encrypt the stored secret on the same schedule.
Cevap
Store the credentials in AWS Secrets Manager in Account B, encrypted with a customer-managed KMS key. Attach an IAM role to the EC2 instances in Account A, and configure the Secrets Manager resource policy and the KMS key policy in Account B to permit the Account A role to retrieve the secret and decrypt using the KMS key. Configure automatic rotation in Secrets Manager using a Lambda function in Account B.
The correct architecture stores credentials securely in AWS Secrets Manager, which supports automated rotation using a Lambda function. Using resource-based policies on the secret and the KMS key in the database account (Account B) allows the IAM role attached to the EC2 instances in Account A to retrieve and decrypt the secret without needing long-term credentials. This adheres to the principles of least privilege and secure cross-account access.
Adım Adım Çözüm
Anahtar Kavram
Cross-account access and credentials rotation utilizing AWS Secrets Manager and AWS KMS with resource-based policies.
Tahmini Süre:3m 0s