'How to list all permissions granted to a specific principal on GCP?

GCP IAM page displays project-wide permissions and principals.

I've granted Object Admin permission to [email protected] to a specific GCS bucket. This permission is not visible on the IAM page.

How do I list all permissions granted to [email protected] across all resources using console or gcloud CLI?



Solution 1:[1]

It seems like this can be done with the gcloud asset command: https://cloud.google.com/sdk/gcloud/reference/asset/search-all-iam-policies

Eg. a basic example query for a single project:

gcloud asset search-all-iam-policies --scope=projects/<project> --query="policy:<email>"

The output is quite verbose, but does what you want, I think.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 somethingsomething