-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Currently GCP don't have any API endpoint which return list of users/service accounts with all assigned roles to it, instead it has API endpoint to list all roles with assigned users to it.
Writing policy is hard/requires more processing where we need to check overprivileged role assignment for specific user/service accounts, as it requires multiple role assignment check for single user.
Suggestion/Steps to create the custom snapshot which will contain list of users/service accounts with all assigned roles to it :
API endpoint at https://cloud.google.com/resource-manager/reference/rest/v1/projects/getIamPolicy returns the list of roles with assigned users to it.
{
"version": 1,
"etag": "BwYBcR2EiGI=",
"bindings": [
{
"role": "roles/iam.serviceAccountAdmin",
"members": [
"serviceAccount:[email protected]",
"user:[email protected]"
]
},
{
"role": "roles/iam.serviceAccountTokenCreator",
"members": [
"serviceAccount:firebase-adminsdk-wxugx@resonant-grail-134310.iam.gserviceaccount.com",
"user:[email protected]"
]
},
{
"role": "roles/owner",
"members": [
"user:[email protected]"
]
}
]
}
I am requesting to generate another custom snapshot out of previous one as follow. we will need both snapshots for different purpose:
{
"version": 1,
"etag": "BwYBcR2EiGI=",
"bindings": [
{
"member": "serviceAccount:[email protected]",
"roles": [
"roles/iam.serviceAccountAdmin"
]
},
{
"member": "user:[email protected]",
"roles": [
"roles/iam.serviceAccountAdmin",
"roles/iam.serviceAccountTokenCreator"
]
},
{
"member": "serviceAccount:firebase-adminsdk-wxugx@resonant-grail-134310.iam.gserviceaccount.com",
"roles": [
"roles/iam.serviceAccountTokenCreator"
]
},
{
"member": "user:[email protected]",
"roles": [
"roles/owner"
]
}
]
}
Metadata
Metadata
Assignees
Labels
No labels