Loading…
Loading…
Explains the RBAC model for the control plane, including available roles, role resolution logic, and how to manage role bindings via the Admin API.
All administrative operations performed via the control plane endpoints (/admin/v1/*) are protected by a Role-Based Access Control (RBAC) system. This system ensures that authenticated principals can only perform actions for which they are authorized.
On every incoming request to the Admin API, the system resolves the caller's authenticated identity to one of three predefined roles. These roles determine the caller's access rights, from read-only observation to full administrative control. This document details the available roles, the resolution process, and the mechanisms for managing role assignments.
The platform defines three distinct roles. Roles are hierarchical; higher-privilege roles inherit all permissions of lower-privilege roles. For example, an admin can perform any action an operator or reader can.
| Role | Description |
|---|---|
admin | Grants full configuration and write access. This includes destructive operations like hard-deleting a service, high-privilege actions such as OpenAPI artifact generation, and management of role and permission bindings. |
operator | Allows management of day-to-day configuration for services, operations, mappings, backend profiles, versions, and settings. This role excludes the destructive and high-privilege operations reserved for admin. |
reader | Provides read-only access to configuration and observability surfaces, including dashboards, metrics, SLO reports, logs, and the audit history. This role has no write access. |
IMPORTANT
The specific endpoints that require operator or admin roles are documented in the Admin API reference.
When a request is received by the Admin API, it follows a strict, ordered sequence to map the caller's identity to a role. This deterministic process ensures a durable fallback path is always available, preventing lockouts due to misconfiguration or external service failures.
flowchart TD
subgraph Admin API
A[Request Received] --> B{Resolve Caller Role};
end
subgraph Role Resolution Steps
B --> C{1. Direct In-App Bindings};
C -- Found --> Z[Role Assigned];
C -- Not Found --> D{2. Forwarded IdP Group Headers};
D -- Found --> Z;
D -- Not Found --> E{3. Directory Group Lookup};
E -- Found --> Z;
E -- Not Found --> F{4. Emergency Bootstrap Variables};
F -- Found --> Z;
F -- Not Found --> X[Access Denied];
endThe resolution steps are executed in the following order:
Direct In-App Principal Bindings: The system first checks for a direct mapping of the user's email to a role within the platform's database (s2r_principal_role_binding table). These bindings are managed via the API and are independent of any external identity provider or directory service. This is the recommended and most durable method for managing permissions.
Forwarded IdP Group Headers: If no direct binding is found, the system inspects request headers (e.g., X-Goog-Authenticated-User-Groups) for group membership information forwarded by an identity-aware proxy. If present, it maps these groups to roles using the configured group-to-role bindings (s2r_role_binding table).
Directory Group Lookup: If group headers are not forwarded, the system can be configured to query the Cloud Identity Groups API to resolve the caller's group memberships. This requires the directory API to be enabled and the platform's service account to have the necessary read permissions. This lookup mechanism is off by default and must be enabled per environment.
Emergency Bootstrap Environment Variables: As a final fallback, the system checks for environment variables that map specific user emails to roles. This is a "break-glass" mechanism intended for initial system setup or emergency access if other methods fail.
The currently resolved identity and role for a caller can be retrieved by making a request to the GET /admin/v1/me endpoint.
Role assignments are managed through two types of bindings, both configured via the Admin API. Managing these bindings is a privileged operation restricted to users with the admin role. All changes to bindings are recorded in the audit trail.
| Method | Endpoint | Description |
|---|---|---|
GET | /admin/v1/role-bindings | Reads the current list of group-to-role bindings. |
PUT | /admin/v1/role-bindings | Replaces the entire list of group-to-role bindings. |
GET | /admin/v1/permission-bindings | Lists all direct user-to-role bindings. |
POST | /admin/v1/permission-bindings | Creates a new direct user-to-role binding or reactivates a deactivated one. |
DELETE | /admin/v1/permission-bindings/{bindingId} | Deactivates a direct user-to-role binding. |
GET | /admin/v1/me | Returns the identity and resolved role for the current caller. |
To grant a user the operator role, an administrator would use the API for direct principal bindings.
List current bindings: An admin can first inspect the existing bindings to prevent duplication.
curl -X GET "https://<api_host>/admin/v1/permission-bindings" \
-H "Authorization: Bearer <ADMIN_TOKEN>"
The source does not specify the exact response payload.
Create a new binding: The admin then creates a new binding by sending a request that maps the user's email to the desired role.
curl -X POST "https://<api_host>/admin/v1/permission-bindings" \
-H "Authorization: Bearer <ADMIN_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "role": "operator"}'
NOTE
The request body in the example above is illustrative. The source does not define the exact payload structure for this endpoint.
Verify the binding: The user can now make a request to GET /admin/v1/me to confirm their identity is resolved to the operator role.
For initial setup or recovery scenarios, roles can be assigned via environment variables. This method should be used sparingly. For steady-state operations, migrate to direct in-app bindings or IdP group mappings.
| Environment Variable | Role Assigned | Description |
|---|---|---|
S2R_ADMIN_BOOTSTRAP_EMAILS | admin | A list of emails to be granted the admin role. |
S2R_ADMIN_BOOTSTRAP_OPERATOR_EMAILS | operator | A list of emails to be granted the operator role. |
S2R_ADMIN_BOOTSTRAP_READER_EMAILS | reader | A list of emails to be granted the reader role. |
WARNING
These variables provide a "break-glass" access mechanism. The lists of emails should be kept minimal and access controlled tightly.
GET /admin/v1/me endpoint with the user's credentials to see how the system is currently resolving their role.admin users lose access, use the S2R_ADMIN_BOOTSTRAP_EMAILS environment variable to grant emergency admin privileges to a designated recovery account. Once access is restored, use the Admin API to create durable in-app bindings and then remove the bootstrap configuration.