A global financial conglomerate is designing a compliance-audited transaction archiving system. An application running on AWS Fargate in the Transaction Processing Account (111111111111) must write hourly transaction logs to an Amazon S3 bucket in a central Audit Account (222222222222). The compliance mandates require that:
1. All logs must be encrypted at rest using a customer managed key (CMK) in AWS KMS. The CMK must reside in the Audit Account.
2. The Fargate task role in the Transaction Processing Account must have the minimum necessary permissions to write the logs but must not be able to read or modify any logs in the S3 bucket.
3. The Audit Account must automatically own all uploaded logs, and all Access Control Lists (ACLs) must be disabled on the bucket.
4. The KMS key policy must enforce least privilege, allowing only the Fargate task role and the Audit Account's administrators to use the key.
Which of the following configurations meets these requirements?
- In the Audit Account, configure S3 Object Ownership to Bucket Owner Enforced on the destination bucket. Create a customer managed KMS key in the Audit Account and configure its key policy to grant the Fargate task role ARN in the Transaction Processing Account permissions for kms:GenerateDataKey and kms:Decrypt. In the Audit Account's S3 bucket policy, grant the Fargate task role ARN permission for s3:PutObject. In the Transaction Processing Account, attach an IAM policy to the Fargate task role allowing s3:PutObject on the Audit bucket and kms:GenerateDataKey and kms:Decrypt on the Audit Account's KMS key.Answer
- BIn the Audit Account, configure S3 Object Ownership to Bucket Owner Enforced on the destination bucket. Encrypt the S3 bucket using the default AWS managed KMS key (aws/s3). Configure the S3 bucket policy in the Audit Account to grant the Fargate task role ARN permission for s3:PutObject. In the Transaction Processing Account, configure the Fargate task role's IAM policy to allow s3:PutObject on the Audit bucket and kms:GenerateDataKey on the aws/s3 key.
- CIn the Audit Account, create a customer managed KMS key. In the AWS Organizations root, apply a Service Control Policy (SCP) to the Organizational Unit containing both accounts that explicitly grants s3:PutObject and kms:GenerateDataKey permissions to the Fargate task role ARN. Rely on this SCP to grant the necessary write permissions to the Transaction Processing Account's Fargate tasks without configuring the local S3 bucket policy or the KMS key policy.
- DIn the Audit Account, create a customer managed KMS key. In the KMS key policy, grant the Fargate task role ARN permissions for kms:GenerateDataKey and kms:Decrypt. In the S3 bucket policy, grant s3:PutObject permission to the AWS Organization ID principal using the aws:PrincipalOrgID condition key, but do not configure S3 Object Ownership, instead requiring the Fargate tasks to supply the bucket-owner-full-control canned ACL in their upload requests.