A company is designing a secure multi-account architecture on AWS. Applications running on Amazon EC2 instances in Account A must write encrypted logs to an Amazon S3 bucket located in Account B. The logs must be encrypted at rest using an AWS KMS customer managed key owned by Account B. The security team needs to configure the required permissions to allow the applications to perform cryptographic operations and upload the logs securely. Which combination of configuration steps will meet these requirements? (Select TWO.)
- In the destination account (Account B), configure the KMS key policy to grant the source account (Account A) permission to perform the `kms:GenerateDataKey` and `kms:Decrypt` actions.Answer
- In the source account (Account A), attach an IAM policy to the EC2 instances' IAM role that grants permissions to perform the `kms:GenerateDataKey` and `kms:Decrypt` actions on the KMS key ARN in Account B.Answer
- CIn the destination account (Account B), grant administrative control of the KMS key directly to the AWS account root user of the source account (Account A) to manage cryptographic permissions, violating least privilege.
- DIn the destination account (Account B), enable automatic key rotation for the KMS customer managed key, expecting AWS to immediately decrypt and re-encrypt all existing historical S3 objects using the new key version.
- EIn the source account (Account A), configure the application to store the database credentials and KMS keys as plaintext String parameters in Systems Manager Parameter Store for direct retrieval by the application instances.
Answer
In Account B, configure the KMS key policy to grant the source account permissions for the cryptographic actions, and in Account A, attach an IAM policy to the application role granting permissions on the target KMS key ARN.
For cross-account access to AWS KMS customer managed keys, permissions must be explicitly declared on both sides. First, the key policy in the destination account must permit the source account's root user or the specific IAM principal to access the key. Second, the source account's IAM role must have an identity-based policy that explicitly grants permission to use the external key ARN for the necessary operations.
Step-by-Step Solution
Key Concept
Cross-account AWS KMS authorization requires matching policies in both the resource owner account and the caller identity account.