Question

Difficulty: MediumStrengthening Identity, Access, and Network Security

A company is strengthening the security posture of an existing data archiving application. The application runs on Amazon EC2 instances within a private subnet in Account A. The application must write archive files to an Amazon S3 bucket located in Account B. The S3 bucket is encrypted using a Customer Managed Key (CMK) in Account B. The security team requires that all network traffic to Amazon S3 and AWS KMS remains within the AWS private network, and that the application's IAM role in Account A is the only entity allowed to write to the S3 bucket and use the KMS key. Which combination of actions must a Solutions Architect implement to meet these requirements? (Select TWO.)

  1. In Account A's VPC, create a Gateway VPC endpoint for Amazon S3 and an Interface VPC endpoint for AWS KMS. Configure the VPC route tables in Account A to route S3 traffic through the Gateway VPC endpoint.Answer
  2. Configure the S3 bucket policy in Account B to allow the s3:PutObject action from the application's IAM role ARN in Account A. Configure the KMS key policy in Account B to allow kms:GenerateDataKey and kms:Decrypt actions for the application's IAM role ARN.Answer
  3. C
    Attach a Service Control Policy (SCP) to the Organizational Unit containing Account A that grants the required S3 and KMS permissions to the application's IAM role, allowing the removal of the local IAM policy in Account A.
  4. D
    Configure the S3 bucket in Account B to use the default AWS-managed KMS key (aws/s3) and update the key policy to delegate cross-account access permissions to Account A.
  5. E
    Deploy a Transit Gateway to route the S3 and KMS traffic to Account B's VPC, using Account B's Gateway VPC endpoints, and associate Account B's Route 53 Private Hosted Zone for S3 with Account A's VPC.

Answer

To establish secure, private cross-account connectivity, the Solutions Architect must deploy a Gateway VPC endpoint for S3 and an Interface VPC endpoint for KMS in Account A. In Account B, the S3 bucket policy and the Customer Managed Key (CMK) policy must be configured to grant access to the application's cross-account IAM role.
Establishing a secure cross-account connection to a KMS-encrypted S3 bucket over private networks requires configuring endpoints for both services in the client VPC. S3 uses a Gateway VPC endpoint, while KMS requires an Interface VPC endpoint because cryptographic data key generation and decryption calls are made directly to KMS endpoints. Additionally, because the resource resides in a different account, the S3 bucket policy and the KMS customer managed key policy in the destination account must explicitly permit actions from the client IAM role ARN.

Step-by-Step Solution

1
Deploy network endpoints in the consumer VPC.
Gateway VPC Endpoint for S3 and Interface VPC Endpoint (PrivateLink) for KMS are created in Account A's VPC.
Since the bucket uses SSE-KMS, the application must perform KMS API calls (GenerateDataKey and Decrypt) in addition to S3 calls. KMS traffic cannot route through the S3 Gateway endpoint and requires a separate Interface endpoint.
2
Establish resource-based cross-account access.
The S3 bucket policy and KMS key policy in Account B are updated with statements targeting the application role in Account A.
IAM policies in Account A alone cannot grant access to resources in Account B. Resource policies in the hosting account must explicitly trust the external IAM entity.

Key Concept

Cross-account access to KMS-encrypted S3 buckets over private endpoints
Rate this question