A SysOps administrator is deploying an application on Amazon EC2 instances. The application needs to retrieve database credentials from AWS Systems Manager (SSM) Parameter Store. The credentials are stored as a SecureString parameter named `/prod/db/password` and are encrypted using a customer managed KMS key.
The EC2 instances are associated with an IAM role that has the following policy attached:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ssm:GetParameter",
"ssm:GetParameters"
],
"Resource": "arn:aws:ssm:us-east-1:111122223333:parameter/prod/db/password"
},
{
"Effect": "Allow",
"Action": [
"kms:Decrypt"
],
"Resource": "arn:aws:kms:us-east-1:111122223333:key/12345678-abcd-1234-abcd-123456789abc"
}
]
}
Despite this configuration, the application logs show an `AccessDeniedException` when calling the `ssm:GetParameter` API with decryption enabled. Which of the following is the most likely cause of this access denied error?
- The KMS key policy for the customer managed key does not allow the EC2 IAM role or the AWS account root principal to perform the `kms:Decrypt` action.Cevap
- BThe administrator must add a permissions boundary to the IAM role that allows the `kms:Decrypt` action, as IAM policies alone cannot grant access to KMS resources without a boundary.
- CThe IAM role policy must include the `iam:PassRole` permission targeting the KMS key to allow Systems Manager to assume the role and decrypt the parameter on behalf of the application.
- DThe subnet route table associated with the EC2 instances is missing a gateway route to the KMS service endpoint, preventing the instance from reaching AWS KMS to perform the decryption.