An architect is designing a secure log aggregation solution. A containerized application running on Amazon ECS in Account A must write encrypted JSON log files to an Amazon S3 bucket located in Account B. The logs must be encrypted at rest using a Customer Managed Key (CMK) in AWS Key Management Service (AWS KMS) owned by Account B.
The security constraints are:
1. The ECS task role in Account A must be able to encrypt new logs during upload but must be strictly prohibited from decrypting any logs already stored in the S3 bucket.
2. The KMS key must be rotated annually without requiring manual re-encryption of existing logs, and older logs must remain decryptable by authorized security analysts in Account B.
Which configuration meets these requirements with the least privilege?
- Configure the KMS key policy in Account B to allow the ECS task role in Account A to perform kms:GenerateDataKey and kms:DescribeKey operations. Enable automatic key rotation on the CMK in Account B.Answer
- BConfigure the KMS key policy in Account B to allow the ECS task role in Account A to perform kms:GenerateDataKey and kms:Decrypt operations. Enable automatic key rotation on the CMK, and configure an AWS Lambda function to automatically decrypt and re-encrypt all historical S3 objects using the new key version upon rotation.
- CConfigure the ECS task to retrieve a plaintext encryption password stored as a String parameter in AWS Systems Manager Parameter Store in Account B, perform client-side encryption of the logs, and manually update the Parameter Store value with a new password annually.
- DConfigure the KMS key policy in Account B to allow the ECS task role in Account A to perform kms:Encrypt and kms:Decrypt operations. Create a new KMS CMK manually in Account B every year, update the S3 bucket default encryption settings to use the new CMK, and delete the previous CMK after 90 days.