An organization is auditing its KMS key configurations. A SysOps Administrator is reviewing a customer managed key (CMK) in Account . The key is used to encrypt an Amazon S3 bucket containing sensitive compliance logs.
The KMS key policy is configured as follows:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Allow Key Administration",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::111122223333:role/AdminRole"
},
"Action": [
"kms:Create*",
"kms:Describe*",
"kms:Enable*",
"kms:List*",
"kms:Put*",
"kms:Update*",
"kms:Revoke*",
"kms:Disable*",
"kms:Get*",
"kms:Delete*",
"kms:TagResource",
"kms:UntagResource",
"kms:ScheduleKeyDeletion",
"kms:CancelKeyDeletion"
],
"Resource": "*"
},
{
"Sid": "Allow S3 Service Access",
"Effect": "Allow",
"Principal": {
"Service": "s3.amazonaws.com"
},
"Action": [
"kms:Decrypt",
"kms:GenerateDataKey"
],
"Resource": "*"
}
]
}
An IAM role in the same account (), `AppExecutionRole`, needs to read objects from this S3 bucket. The administrator attaches the following IAM policy to `AppExecutionRole`:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "S3AndKMSRead",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"kms:Decrypt"
],
"Resource": [
"arn:aws:s3:::compliance-logs-111122223333/*",
"arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
]
}
]
}
However, when an application using the `AppExecutionRole` attempts to retrieve an object from the S3 bucket, it receives an "Access Denied" error from KMS.
Which action should the SysOps Administrator take to resolve this issue?
- AModify the IAM policy attached to `AppExecutionRole` to set the resource for the `kms:Decrypt` action to a wildcard (`*`).
- BAdd a statement to the S3 bucket policy of `compliance-logs-111122223333` that explicitly grants the `AppExecutionRole` permission to perform `kms:Decrypt` on the KMS key.
- Add a statement to the KMS key policy that grants the AWS account root principal (`arn:aws:iam::111122223333:root`) access to the `kms:*` actions on the key, allowing IAM policies to delegate permissions.Cevap
- DConfigure an IAM role trust policy on `AppExecutionRole` that allows the KMS service principal (`kms.amazonaws.com`) to assume the role.