A SysOps Administrator is configuring an AWS Lambda function in AWS Account to decrypt sensitive application configuration files. The configuration files are encrypted using a customer managed KMS key. The Administrator has attached an IAM policy to the Lambda function's execution role that grants permission for the `kms:Decrypt` action on the KMS key. However, when executing, the Lambda function fails with an AccessDeniedException during the decryption step.
Upon inspecting the KMS key policy, the Administrator finds only the following statement:
{
"Sid": "Allow Key Administration",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::555555555555:role/SysOpsAdminRole"
},
"Action": "kms:*",
"Resource": "*"
}
Which modification to the KMS key policy will resolve this issue by allowing the Lambda function's IAM policy to take effect?
- AModify the KMS key policy to trust the KMS service principal (`kms.amazonaws.com`) under the Principal element.
- BUpdate the Principal in the key policy's existing statement to specify `*` and add a Condition block that restricts access to the Lambda execution role.
- Add a statement to the KMS key policy that grants the root user of account (`arn:aws:iam::555555555555:root`) permissions for all KMS actions (`kms:*`).Answer
- DAdd a statement to the KMS key policy that explicitly denies the execution role any administrative actions, forcing evaluation to default to the IAM policy.