Apex Cargo Systems is designing a new cloud architecture. An application hosted on Amazon ECS tasks in the Operations account (Account ) must write transactional log files to an Amazon S3 bucket located in the Compliance Archive account (Account ). The logs must be encrypted at rest using an AWS KMS key managed by the Compliance team. The solution must ensure that files written to the bucket are encrypted and that the Operations account has the minimum necessary privileges to perform these writes.
Which combination of configuration steps will satisfy these security and compliance design requirements?
- AUse the AWS-managed key `aws/s3` in the Compliance Archive account to encrypt the S3 bucket. Configure the S3 bucket policy to allow the Operations account's ECS task role to perform `s3:PutObject`. In the Operations account, configure the ECS task role's IAM policy to allow `s3:PutObject` on the S3 bucket and `kms:GenerateDataKey` on the `aws/s3` key.
- BCreate a Customer Managed Key (CMK) in the Compliance Archive account. Create a Service Control Policy (SCP) at the Organization level that allows the Operations account's ECS task role to write to the S3 bucket and use the CMK. Apply the SCP to both accounts to delegate permissions without modifying individual resource policies.
- Create a Customer Managed Key (CMK) in the Compliance Archive account. Configure the CMK key policy to allow the Operations account's ECS task role to perform `kms:GenerateDataKey` and `kms:Decrypt` actions. In the Compliance Archive account, configure the S3 bucket policy to allow `s3:PutObject` from the Operations account's ECS task role. In the Operations account, configure the ECS task role's IAM policy to allow `s3:PutObject` on the destination S3 bucket and `kms:GenerateDataKey` on the CMK.Answer
- DCreate a Customer Managed Key (CMK) in the Compliance Archive account. Configure the CMK key policy to allow the Operations account's ECS task role to perform `kms:GenerateDataKey` and `kms:Decrypt`. In the Compliance Archive account, configure the S3 bucket policy to allow `s3:PutObject` from the Operations AWS account's root principal (`arn:aws:iam::111122223333:root`), but do not assign any S3 write permissions to the ECS task role's IAM policy, relying on the bucket policy to grant direct access.
Answer
Create a Customer Managed Key (CMK) in the Compliance Archive account, authorizing the Operations account's ECS task role in its key policy. Configure the destination S3 bucket policy to allow writes from the same ECS task role, and configure the ECS task role's local IAM policy to allow writes to the destination bucket and key generation on the CMK.
The correct option correctly uses a Customer Managed Key (CMK), since AWS-managed KMS keys cannot be shared across accounts. It also establishes permissions on both sides of the trust boundary: the destination resource policies (S3 bucket policy and KMS key policy) permit access from the source identity, and the source identity's IAM policy allows it to perform the actions on those target resources.
Step-by-Step Solution
Key Concept
Cross-account resource sharing utilizing KMS Customer Managed Keys, S3 Bucket Policies, and IAM Identity Policies.