Blog

How to Check User Role Assignments in Google Cloud

1 i6dgvab5wujxnd8n yijpg

Often, when troubleshooting user access we need to understand the roles assigned to a user. When using email or similar electronic messaging a clear answer can get lost in communication.

Without the need to employ any rocket science, advanced calculus, or any other mystical wizardry, a simple script can help to quickly and cleanly communicate the data directly from the cloud environment.

So, using something like this…

gcloud organizations get-iam-policy <ORGANIZATION_ID> --filter="bindings.members:<[email protected]>" --flatten="bindings[].members" --format="table(bindings.role)" > roles.txt

…provides a nice clean output file that can be easily shared and looks similar to this.

ROLE
roles/billing.admin
roles/compute.xpnAdmin
roles/iam.organizationRoleAdmin
roles/orgpolicy.policyAdmin
roles/resourcemanager.organizationAdmin
roles/securitycenter.admin
roles/storage.admin

With the above, we’re getting data directly from the cloud environment that all stakeholders involved may use.

Subscribe to updates, news and more.

Related blogs

Schedule a call with our team

You will receive a calendar invite to the email address provided below for a 15-minute call with one of our team members to discuss your needs.

You will be presented with date and time options on the next step