An application running on an IAM role in Account A (999988887777) needs to read messages from an encrypted Amazon SQS queue in Account B (555544443333). The queue is encrypted using a customer managed KMS key in Account B. The administrator has attached the following IAM policy to the role in Account A:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowSQSandKMS",
"Effect": "Allow",
"Action": [
"sqs:ReceiveMessage",
"sqs:DeleteMessage",
"kms:Decrypt"
],
"Resource": [
"arn:aws:sqs:us-east-1:555544443333:TargetQueue",
"arn:aws:kms:us-east-1:555544443333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
]
}
]
}
The SQS queue policy in Account B allows the IAM role in Account A to perform SQS actions. The KMS key policy in Account B contains the following default statement:
{
"Version": "2012-10-17",
"Id": "key-default-1",
"Statement": [
{
"Sid": "Enable IAM User Permissions",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::555544443333:root"
},
"Action": "kms:*",
"Resource": "*"
}
]
}
When the application in Account A attempts to read messages from the queue, it fails with a KMS access denied error. What must the administrator do to resolve this issue?
- AModify the SQS queue policy in Account B to include the kms:Decrypt permission on the KMS key for the IAM role in Account A.
- BCreate a new IAM policy in Account B that grants the IAM role in Account A permissions to decrypt using the KMS key.
- Modify the KMS key policy in Account B to explicitly allow the IAM role in Account A to perform the kms:Decrypt action.Answer
- DRely on the existing configuration, as the default key policy statement delegates all decryption permissions to the IAM policies of any trusting account.