A SysOps Administrator in Account is troubleshooting a decryption error. An application running on an Amazon EC2 instance with the IAM role `AppExecutionRole` attached is attempting to decrypt a configuration file using a Customer Managed Key (CMK). The IAM policy attached to `AppExecutionRole` contains the following statement:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowKmsDecrypt",
"Effect": "Allow",
"Action": "kms:Decrypt",
"Resource": "arn:aws:kms:us-east-1:111111111111:key/12345678-1234-1234-1234-123456789012"
}
]
}
However, the application receives a `KMS.AccessDeniedException` when calling the `Decrypt` API. The Administrator reviews the current KMS key policy for the CMK:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowKeyAdmins",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::111111111111:role/KmsAdminRole"
},
"Action": [
"kms:Create*",
"kms:Describe*",
"kms:Enable*",
"kms:List*",
"kms:Put*",
"kms:Update*",
"kms:Revoke*",
"kms:Disable*",
"kms:Get*",
"kms:Delete*",
"kms:ScheduleKeyDeletion",
"kms:CancelKeyDeletion"
],
"Resource": "*"
}
]
}
Which changes will resolve the decryption error? (Select TWO.)
- Add a statement to the KMS key policy that grants the root account principal (`arn:aws:iam::111111111111:root`) permissions for `kms:*` to enable IAM policy delegation.Answer
- Add a statement to the KMS key policy that explicitly grants the `AppExecutionRole` principal (`arn:aws:iam::111111111111:role/AppExecutionRole`) permission to perform the `kms:Decrypt` action.Answer
- CAdd the `AppExecutionRole` ARN to the existing `AllowKeyAdmins` statement in the KMS key policy.
- DModify the IAM policy attached to `AppExecutionRole` to change the resource to the KMS key alias instead of the key ARN.
- EModify the IAM policy attached to `AppExecutionRole` to include the `kms:DescribeKey` action, which allows the IAM permissions to override the key policy.