Assign RBAC roles to a service account
You can assign RBAC roles to a service account to control exactly which API actions it is authorized to perform.
Before you begin
- A service account exists in the target project. For more information, see Create a service account.
- You have the project administrator role in the project, or you have the
role-assignment:assignpermission. - You know the name of the role you want to assign. For a list of available roles, query the roles API or consult your automation orchestrator administrator.
About this task
Service accounts receive direct role assignments only. Unlike human users, service accounts cannot be members of groups.
By default, a newly created service account has no permissions. You must explicitly assign roles to grant the service account access to specific resources and actions.
Roles can be project-scoped or global. The scope determines where the service account's permissions apply:
- Project-scoped roles grant permissions within a specific project only. Most service account use cases require project-scoped roles, because service accounts typically interact with resources in a single project.
- Global roles grant permissions across the entire platform. Assign global roles only when the service account must access resources across multiple projects or perform platform-level operations.
Follow the principle of least privilege: assign only the roles that the service account needs to perform its intended function.