An energy trading enterprise runs its core transaction processing platform on Amazon ECS tasks within a Production account (Account 111111111111). The enterprise is designing a compliance archiving architecture where transaction logs must be written directly from the ECS tasks to an Amazon S3 bucket located in a dedicated Audit account (Account 222222222222).
The security requirements are as follows:
- Cryptographic control over the logs must remain within the Production account.
- The logs must be encrypted at rest when stored in the S3 bucket.
- The Audit account users must have the ability to read and decrypt these logs.
- The S3 Object Ownership must be configured so that the Audit account automatically owns all uploaded logs, and access control lists (ACLs) are disabled.
- The ECS task roles must be granted only the minimum required permissions.
Which configuration strategy meets these requirements while adhering to the principle of least privilege?
- In Account 111111111111, create a KMS customer managed key (CMK). Configure the CMK key policy to allow the Production ECS task role to perform kms:GenerateDataKey and kms:Decrypt, and allow Account 222222222222 to perform kms:Decrypt. In Account 222222222222, set S3 Object Ownership to Bucket Owner Enforced on the S3 bucket. Configure the S3 bucket policy to allow s3:PutObject permissions only to the Production ECS task role principal. Attach an IAM policy to the Production ECS task role that grants s3:PutObject on the Audit S3 bucket and kms:GenerateDataKey and kms:Decrypt on the Production CMK.Answer
- BIn Account 111111111111, configure the ECS tasks to encrypt S3 uploads using the AWS-managed KMS key aws/s3. In Account 222222222222, set S3 Object Ownership to Bucket Owner Enforced on the S3 bucket. Configure the S3 bucket policy to allow s3:PutObject permissions to the Production ECS task role principal. Attach an IAM policy to the Production ECS task role that grants s3:PutObject on the Audit S3 bucket and kms:GenerateDataKey on the aws/s3 key.
- CIn Account 111111111111, create a KMS customer managed key (CMK). Configure the CMK key policy to allow the Production ECS task role to perform kms:GenerateDataKey and kms:Decrypt, and allow Account 222222222222 to perform kms:Decrypt. Attach a Service Control Policy (SCP) to the Production Organizational Unit (OU) that allows s3:PutObject on the Audit S3 bucket, and rely on this SCP to grant the ECS task role write permissions without a local IAM policy. In Account 222222222222, set S3 Object Ownership to Bucket Owner Enforced and configure the S3 bucket policy to allow s3:PutObject permissions to the Production ECS task role principal.
- DIn Account 111111111111, create a KMS customer managed key (CMK). Configure the CMK key policy to allow the Production ECS task role to perform kms:GenerateDataKey and kms:Decrypt, and allow Account 222222222222 to perform kms:Decrypt. In Account 222222222222, set S3 Object Ownership to Bucket Owner Enforced. Configure the S3 bucket policy to allow s3:PutObject with a Principal of * and use the aws:PrincipalOrgID condition key to restrict access to the organization, omitting specific ECS task role principal declarations. Attach an IAM policy to the Production ECS task role that grants s3:PutObject on the Audit S3 bucket and kms:GenerateDataKey and kms:Decrypt on the Production CMK.