Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow checking multiple permissions at once #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NAjustin
Copy link

@NAjustin NAjustin commented Apr 2, 2024

I know this is an old repo, but I found it useful and wanted to share a helpful improvement.

Currently the list-roles-with-permission.sh script only allows checking a single permission. I was working with the output of the GCP Security Insights, which shows a list of recently-used permissions like this:
image

I wanted to check which role(s) provided all of those permissions without having to check and compare one at a time. So I modified your script to produce a JSON array from variable arguments, and do an array-to-array comparison using jq.

I found the current name to be confusing with this new functionality, so to maintain compatibility I modified that file to only be an alias to the new plural version of the script. Docs are also updated.

This change facilitates checking a combination of permissions at once, which is useful when working with the output of the Security Insights permission analyzer (which shows the permissions used in the most recent period) or any other permission auditing tool to maintain a principal of least privilege.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant