SimulateCustomPolicy operation: Invalid Input Actions: [kms:Decrypt] and [kms:List*] require different authorization information

0

Getting "Invalid Input Actions" while making SimulateCustomPolicy with 2 KMS actions, works fine if pass 1 action at a time with same resource ARN and same PolicyInputList.

Below are some variations I tried in action-names and resource-arn, it is weird that multiple action call is failing only for KMS. I have tired cloudwatch, sqs calls with multiple actions and resource arn and working fine.

Failing: aws iam simulate-custom-policy
--policy-input-list '{"Version":"2012-10-17","Statement": [.....]}'
--action-names kms:Decrypt kms:List*
--resource-arns arn:aws:kms:::key/abc arn:aws:kms:::key/xyz

Passed: aws iam simulate-custom-policy
--policy-input-list '{"Version":"2012-10-17","Statement": [.....]}'
--action-names kms:List*
--resource-arns arn:aws:kms:::key/xyz arn:aws:kms:::key/abc

Passed: aws iam simulate-custom-policy
--policy-input-list '{"Version":"2012-10-17","Statement": [.....]}'
--action-names kms:Decrypt
--resource-arns arn:aws:kms:::key/xyz arn:aws:kms:::key/abc

Manan
已提问 2 年前653 查看次数
2 回答
1

Hi,

Thank you for contacting us! I understand that you would like to simulate a custom policy to determine the policy's effective permissions evaluated against multiple actions and resources.

I confirm that you are able to use the 'simulate-custom-policy' CLI command on multiple actions and resources. The following sample command worked for me:

aws iam simulate-custom-policy --policy-input-list '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"kms:*","Resource":"arn:aws:kms:us-east-1:<account-ID>:key/12345-6789-12345asdf-fghj-123455yz"}]}' --action-names "kms:Decrypt" "kms:ListGrants" --resource-arns "arn:aws:kms:us-east-1:<account-ID>:key/12345-6789-12345asdf-fghj-123455yz" "arn:aws:kms:us-east-1:<account-ID>:key/abcdef-6789-12345asdf-fghj-123455abcd"

Note the format I have used to include multiple action names and resources within double quotes.

This syntax for passing multiple action names and resources is also outlined in the following document under the --action-names and --resource-arns CLI options:

Please let us know if you need any further assistance. We'll be glad to assist!

AWS
支持工程师
已回答 2 年前
0

I think I found the issue, the policy has actions names with STAR. Like kms:List* to include all the actions starts with List.

I have tried few other combinations with other AWS services actions (i.e. S3, CloudWatch, CloudFormation) and it seems the same issue. It only works when Resource is provided with *. If Resource has ARN and Action name has STAR it will fail.

Manan
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则