This website uses cookies essential to its operation, for analytics, and for personalized content. By continuing to browse this site, you acknowledge the use of cookies. For details on cookie usage on our site, read our Privacy Policy
I figured it out. Here is the query I used. config from cloud.resource where cloud.type = 'aws' AND api.name = 'aws-iam-list-roles' AND json.rule = inlinePolicies[*].policyDocument.Statement[?any( Action contains "sts:AssumeRole" and Resource equals "*" )] exists
... View more
Trying to put together a query to identify excessive assumeRole permissions. For example it would identify if the following is in a policy. "Action": ["sts:AssumeRole"], "Effect": "Allow", "Resource": "*" I've been messing around with some queries, I haven't had any luck finding one that works. The following query will pickup policies where the "sts:AssumeRole" and the "*" are in separate statement blocks. config from cloud.resource where cloud.type = 'aws' AND api.name = 'aws-iam-list-roles' AND json.rule = inlinePolicies[*].policyDocument.Statement[*].Action contains "sts:AssumeRole" and inlinePolicies[*].policyDocument.Statement[*].Resource equals "*"
... View more