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
gefragt vor 2 Jahren653 Aufrufe
2 Antworten
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
SUPPORT-TECHNIKER
beantwortet vor 2 Jahren
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
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen