Exploring GCP Roles with StackQL
· 4 min read
Understanding roles is integral to applying the principal of least privilege to GCP environments.
A quick primer on roles in GCP
A Role in GCP is a collection of permissions to services and APIs on the platform. Roles are "bound" to principals or members (users, groups and service accounts).
These bindings are referred to as "policies" which are scoped at a particular level - organisation, folder, project, resource.
There are three types of roles - Primitive Roles, Predefined Roles and Custom Roles.
Primitive (or Basic) Roles
These are legacy roles set at a GCP project level which include Owner, Editor, and Viewer. These are generally considered to be excessive in terms of permissions and their use should be minimised if not avoided altogether.