An application deployed on AWS Lambda in Account A () needs to retrieve and decrypt S3 objects from an Amazon S3 bucket located in Account B (). The S3 bucket is configured with Server-Side Encryption (SSE-KMS) using a KMS customer managed key.
Which two AWS KMS configuration steps are required to enable the Lambda function to decrypt the objects? (Select TWO.)
- In Account B, modify the KMS customer managed key's key policy to grant the Lambda execution role in Account A permission to perform the kms:Decrypt action.Answer
- In Account A, attach an IAM policy to the Lambda execution role that grants the kms:Decrypt permission on the ARN of the customer managed key in Account B.Answer
- CIn Account B, configure the S3 bucket policy to grant kms:Decrypt permissions to the Lambda execution role from Account A.
- DConfigure the S3 bucket in Account B to use the default AWS managed key aws/s3 for encryption and grant the Lambda execution role kms:Decrypt permission on that key.
- EIn Account A, store the KMS key's plaintext backing key in Systems Manager Parameter Store as a SecureString parameter and grant the Lambda execution role read access.
Answer
The Lambda function execution role requires permissions in both accounts: a KMS key policy update in Account B to allow the role to perform the kms:Decrypt operation, and an IAM policy in Account A allowing the role to call the kms:Decrypt action on the key's ARN in Account B.
For cross-account access to KMS keys, permissions must be granted by both the resource owner (Account B) and the consumer (Account A). First, the KMS customer managed key's policy in Account B must be modified to trust and allow the Lambda execution role ARN from Account A to perform the decryption operation. Second, the Lambda execution role in Account A must have an IAM policy attached that permits it to perform the decryption action against the KMS key ARN in Account B.
Step-by-Step Solution
Key Concept
Cross-account KMS authorization requires permission grants in both the KMS key policy (resource-based) and the caller's IAM policy (identity-based), and AWS managed keys do not support cross-account sharing.