A compliance auditor operating from an external AWS account (Account B) requires access to read consolidated AWS CloudTrail logs stored in an Amazon S3 bucket within the main corporate AWS account (Account A). The log files are encrypted with an AWS KMS customer managed key in Account A. The SysOps Administrator has attached an IAM policy to the auditor's IAM role in Account B that permits s3:GetObject on the S3 bucket and kms:Decrypt on the KMS key. The S3 bucket policy in Account A has also been updated to allow access from the auditor's role in Account B. However, when the auditor attempts to retrieve a log file, they receive an Access Denied error. Which action must the SysOps Administrator perform to resolve this issue?
- AConfigure a bucket policy on the S3 bucket in Account A to grant kms:Decrypt permissions directly to the auditor's IAM role in Account B.
- BAdd the iam:PassRole permission to the auditor's IAM role in Account B, specifying the ARN of the KMS key in Account A as the resource.
- Update the key policy of the KMS key in Account A to allow the auditor's IAM role in Account B to perform the kms:Decrypt action.Answer
- DEnable detailed monitoring on the CloudTrail trail in Account A to automatically propagate decryption credentials to Account B.
Answer
Update the key policy of the KMS key in Account A to allow the auditor's IAM role in Account B to perform the kms:Decrypt action.
For cross-account access to KMS-encrypted data, authorization must be granted by both the external identity's account and the resource owner's account. Because the customer managed key is in Account A and the auditor is in Account B, the KMS key policy in Account A must explicitly allow the auditor's IAM role ARN to perform the kms:Decrypt action. Once this key policy permission is in place, it works in tandem with the auditor's IAM policy in Account B to permit successful decryption.
Step-by-Step Solution
Key Concept
Cross-account KMS key delegation and policy precedence
Estimated Time:2m 30s