An enterprise application running on Amazon EC2 instances in Account A must retrieve database archives from an Amazon S3 bucket located in Account B. The bucket, named `corporate-db-archives`, uses a customer managed key (CMK) in AWS KMS for server-side encryption. The EC2 instances are associated with an IAM role in Account A named `ArchiveReaderRole`. A developer has already attached a permissions policy to `ArchiveReaderRole` that permits S3 read operations on the bucket and KMS decrypt operations on the CMK. Which two resource-based policies in Account B must be updated to successfully authorize this cross-account read operation? (Select two.)
- The S3 bucket policy of `corporate-db-archives` to grant S3 read permissions to the IAM role `ArchiveReaderRole` in Account AAnswer
- The KMS key policy of the CMK to grant decrypt permissions to the IAM role `ArchiveReaderRole` in Account AAnswer
- CThe trust policy of `ArchiveReaderRole` in Account A to trust the S3 service principal (`s3.amazonaws.com`)
- DThe trust policy of the KMS key in Account B to trust the IAM role `ArchiveReaderRole` in Account A as an entity that can assume the key
- EThe user permissions policy of a new IAM user in Account B, using its static access credentials to configure the EC2 application code
Answer
The correct resource-based policies to update are the S3 bucket policy of the S3 bucket and the KMS key policy of the customer managed key in Account B to grant access to the IAM role in Account A.
For cross-account access to encrypted S3 resources, the resource-based policies in the destination account (Account B) must explicitly authorize the external principal from the source account (Account A). Thus, both the S3 bucket policy must allow the read operations and the KMS key policy must allow the decrypt operations for the external IAM role.
Step-by-Step Solution
Key Concept
Cross-account IAM delegation requires explicit resource-based policy alignment (S3 bucket and KMS key policies) to authorize external principals.