A healthcare provider is deploying a centralized vulnerability scanner in a dedicated Audit account. The scanner must read raw medical record files stored in an Amazon S3 bucket within a separate Operations account. The files are encrypted with server-side encryption using AWS KMS (SSE-KMS). The scanner runs as a containerized task on AWS Fargate in the Audit account, using an IAM task role named AuditScannerRole.
Which configuration strategy should a solutions architect implement to allow AuditScannerRole to decrypt and retrieve these files?
- Set the S3 bucket in the Operations account to encrypt objects with a customer managed KMS key. Modify the key policy of this customer managed key to allow the Audit account to perform kms:Decrypt actions. Grant AuditScannerRole IAM permissions for s3:GetObject on the bucket and kms:Decrypt on the key, and update the Operations bucket policy to allow the AuditScannerRole s3:GetObject access.Answer
- BUse the AWS managed key (aws/s3) to encrypt the S3 bucket in the Operations account. In the Audit account, attach an IAM policy to AuditScannerRole that grants s3:GetObject permissions on the Operations S3 bucket and kms:Decrypt permissions on the aws/s3 key ARN from the Operations account.
- CSet the S3 bucket in the Operations account to encrypt objects with a customer managed KMS key. Attach a Service Control Policy (SCP) to the Organizational Unit (OU) containing both accounts that explicitly grants AuditScannerRole permissions to perform kms:Decrypt on the key and s3:GetObject on the bucket.
- DSet the S3 bucket in the Operations account to encrypt objects with a customer managed KMS key. Have the scanner container assume an IAM role in the Operations account to read the files, but configure the trust policy of the Operations IAM role to trust the Audit account without specifying the sts:AssumeRole action in the statement.
Answer
Configure the S3 bucket to use a customer managed KMS key, modify the key policy of this key to delegate kms:Decrypt access to the Audit account, grant the AuditScannerRole IAM permissions to read the bucket and decrypt using the key, and update the bucket policy in the Operations account to grant s3:GetObject permissions to the AuditScannerRole.
To decrypt and access S3 objects across accounts, you must use a customer managed KMS key. The KMS key policy in the Operations account must delegate decrypt permissions to the Audit account (or specifically the scanner role). Additionally, the resource policies (KMS key policy and S3 bucket policy) and the identity-based IAM policy in the Audit account must all align to grant the necessary read and decrypt access.
Step-by-Step Solution
Key Concept
Cross-account Amazon S3 access with KMS encryption requires a customer managed key, delegating decryption permissions in the KMS key policy, allowing read access in the S3 bucket policy, and granting identity-based permissions in the consumer account.