An enterprise is auditing its AWS environment to strengthen network and identity security for a data processing application. The application runs on Amazon EC2 instances in a private subnet within VPC A (Account A) and reads and writes sensitive objects in an Amazon S3 bucket located in Account B. VPC A is connected to a shared services VPC in Account B via an AWS Transit Gateway. Currently, the EC2 instances access the S3 bucket via an S3 Gateway Endpoint in VPC A. The S3 bucket is encrypted using the default AWS managed key (aws/s3). The current S3 bucket policy allows read and write access to the IAM role attached to the EC2 instances. The security architect must implement a solution to restrict S3 bucket access so that it is only reachable from VPC A, prevent the application from accessing any S3 buckets other than the designated one in Account B, and enforce encryption with a key that supports cross-account access. What is the most secure and operationally efficient configuration to meet these requirements?
- Configure a Customer Managed Key (CMK) in Account B for S3 bucket encryption, and update its key policy to allow the application's IAM role in Account A to perform kms:Decrypt and kms:GenerateDataKey operations. Update the VPC A S3 Gateway Endpoint policy to permit s3:GetObject and s3:PutObject only for the Account B bucket. In Account B, configure the S3 bucket policy to allow access from the IAM role in Account A, with a condition restricting access to the Gateway Endpoint ID (aws:sourceVpce) of VPC A.Answer
- BKeep the default S3 encryption with the AWS managed key (aws/s3). Update the IAM policy of the application's IAM role in Account A to permit kms:Decrypt and kms:GenerateDataKey on the S3 managed key. Update the VPC A S3 Gateway Endpoint policy to limit access to the Account B bucket. In Account B, configure the S3 bucket policy to allow access from the IAM role in Account A, restricting access to the source IP range of VPC A using the aws:SourceIp condition.
- CConfigure a Customer Managed Key (CMK) in Account B for S3 bucket encryption, granting key access to Account A's root user. Create an S3 Gateway Endpoint in the Shared Services VPC (Account B). Update the Transit Gateway route tables to route all S3-destined traffic from VPC A to Account B's Gateway Endpoint. Configure the S3 bucket policy to allow access from Account A's IAM role, restricting access to VPC A's VPC ID using the aws:sourceVpc condition.
- DConfigure a Customer Managed Key (CMK) in Account B for S3 bucket encryption, granting key access to Account A's IAM role. In VPC A, delete the Gateway Endpoint and create an S3 Interface Endpoint. Attach an endpoint policy to the Interface Endpoint that allows access to all S3 resources. Create a Route 53 Private Hosted Zone (PHZ) in Account B for s3.amazonaws.com, associate it with VPC A, and configure the S3 bucket policy in Account B to restrict access to the Interface Endpoint's private IP addresses.