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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠