Can someone help me with an RQL to display the list of Users, policies attached, and the actions allowed in the policies.
I want to be able to export this into a CSV. Any help here is much appreciated.
Solved! Go to Solution.
I would like to output the list of AWS IAM users, the policies attached to each user, and the list of Actions that they're allowed. If this could be displayed in three different columns, that would be great!
Thanks in advance,
So users can have inline policies as well as attached policies. It would be difficult to show it all in one pane due to the joins that would need to be used. Do you only want to list users that have inline or attached policies? Or a complete list of users regardless of policies?
If space is a constraint, we can do it two iterations. First one shows all the users with attached policies and the actions allowed. Second shows all the users with inline policies and actions allowed.
How's this to begin with?.. but no luck though..
config where api.name = 'aws-iam-list-attached-user-policies' as X; config where api.name = 'aws-iam-get-policy-version' as Y; filter "$.X.attachedPolicies.policyArn==$.Y.policyArn and $.Y.document.Statement[?(@.Effect == 'Allow' && @.Action is not empty]; show Y;
This should get you what you are looking for (you were missing the brackets for the array (attachedPolicies):
config where api.name = 'aws-iam-list-attached-user-policies' as X; config where api.name = 'aws-iam-get-policy-version' as Y; filter "$.X.attachedPolicies[*].policyArn==$.Y.policyArn and $.Y.document.Statement[?(@.Effect=='Allow')].Action is not empty"; show Y;
Thank you, this is helpful. But how can I list all the allowed actions in the form of a column. My end goal is to export this to a CSV which shows all the user policies and actions it allows. Currently, if I were to export it, the output doesn't display the list of actions allowed.
You won't be able to do that within the UI due to the sheer number of actions that could be returned. I would suggest using our API to pull the data you want and export it into CSV format.
I believe it will show only the first case that attached policies with action only.Not inline policy details with action.Also please help me to understand where it's showing list of user names and respective policy details and action details.The report is showing only list of policy details not even action??
Please correct me if i am wrong??
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!
The Live Community thanks you for your participation!