Roles and RoleBindings
The built-in roles, the bindings that carry a role to a subject, and the rules of a custom organization role.
A role is a set of rules that say which verbs a subject holds on which kinds, and a binding carries a role to a subject for one namespace, one organization or everywhere. This page lists the built-in roles, how far each kind of binding reaches and the rules of a custom organization role.
apiVersion: core.ringleader.dev/v1
kind: RoleBindingRoles and grants explains ownership, organization administrators and Grants, and shows how to give someone a role. Grant lists the fields of a Grant.
Built-in roles
The built-in roles define what a subject may do. Ringleader predefines them, so their meaning is the same everywhere, and you do not write them.
The first four roles form a ladder. Each role contains every role above it in the table, so each row states only what it adds. node-owner and public-info are not part of the ladder, because every authenticated user holds both, and global-admin sits outside it entirely.
| Role | Who gets it | What it adds |
|---|---|---|
namespace-reader | Shared-namespace members, where Org.spec.defaultMemberRole selects it | get, list and watch on everything in the namespace, and create, update and delete on your device-local localbindings and sshkeys. It creates nothing else, in particular no workstation, which on a cloud-backed organization is real spend. |
namespace-member | You, in a shared namespace (the default role) | Owner-scoped create, update and delete on workstations, secrets, workstationconfigs, configmaps, grants, serviceaccounts, integrations, workstationpools and workstationpoolleases, your own only. |
namespace-admin | You, in your personal namespace, and the admins of a shared one | The same verbs for any owner, not just your own. They include these kinds of the namespace: workstations, workstationconfigs, configmaps, secrets, grants, serviceaccounts, integrations, workstationpools, workstationpoolleases, cloudidentities, edges, policies, storages, sshkeys, localbindings, and the namespace’s own roles and rolebindings. It is not a blanket wildcard. An admin also holds the lease right on every workstation pool in the namespace and the The cloudconfig Grant on every workstation. It reads every cloud workstation’s connection records in the namespace, and, through the usage verb on workstations, every owner’s usage. A member reads only their own of either. |
org-admin | An organization’s administrators | Everything a namespace-admin has, in every namespace of their organization, plus that organization’s own structure: its namespaces, orgroles, orgrolebindings, CloudAccounts, identityproviders and orgpolicies, plus read-only access to its user roster. It also reads the usage of the whole organization with rl usage --org. Confined to their own organization. Reading the organization and its domains is not one of these, because every authenticated user can read their own, through public-info. |
node-owner | Every authenticated user | Owner-scoped management of your own device records (nodeinfos). |
public-info | Every authenticated user | get, list and watch on namespaces, organizations and their domains, and role definitions and organization role bindings, so you can see who administers your organization. The user roster is not included. |
global-admin | Ringleader operators (break-glass) | Full access to everything, everywhere. The only role that holds the wildcard. |
Two limits hold for every role below global-admin:
- No built-in role below
global-admingrantsaccesson a Secret it does not own. An administrator owns a Secret’s object lifecycle and can delete it. Reading a plaintext they do not own still needs ownership, a Grant, or a custom role with theaccessverb onsecrets. - No role can escalate itself. You cannot bind a subject, yourself included, to permissions you do not already hold.
Reach of a role binding
A role is a set of rules. The binding that carries it decides where it applies:
| Binding | Reaches |
|---|---|
RoleBinding (namespaced) | One namespace. |
OrgRoleBinding (cluster-scoped, carries spec.org) | Every namespace of one organization, including ones created later, plus that organization’s own structure: its namespaces, organization roles, organization role bindings, organization policies, cloud accounts, identity providers and user roster. |
GlobalRoleBinding (cluster-scoped) | Everywhere. Ringleader operators only. |
A binding may reference a built-in GlobalRole, a namespaced Role, or an organization-scoped OrgRole. An OrgRoleBinding’s reach over cluster-scoped objects is confined to the organization’s own. It can never grant a verb on another organization’s objects, or on global roles.
To see what you hold at each origin, run rl auth status --show-access.
Custom organization roles
A custom organization role (OrgRole) is a set of rules that an org-admin writes for one organization. Each rule names API groups, resources and verbs. A resource is the plural kind name, such as workstations. Its API group is the part of the kind’s apiVersion before the slash: workstations.ringleader.dev for a Workstation, core.ringleader.dev for a Secret. "*" matches any group, resource or verb.
A rule with ownerScope: true applies only to objects the subject owns, the way the built-in namespace-member role lets you change your own workstations and nobody else’s. Both objects carry spec.org, and Ringleader accepts the role only because every rule in it is a subset of what its author already holds.
Example: a RoleBinding
A RoleBinding in a namespace binds a person to a built-in role:
apiVersion: core.ringleader.dev/v1
kind: RoleBinding
metadata: { name: bob-team-a, namespace: acmecorp-team-a }
spec:
subjects: ["user:bob@acme.com"]
roleRef: { kind: GlobalRole, name: namespace-member }Example: an OrgRoleBinding
An OrgRoleBinding makes someone an administrator of every namespace of the organization. Ringleader creates the first one for your organization.
apiVersion: core.ringleader.dev/v1
kind: OrgRoleBinding
metadata:
name: acmecorp-admins
spec:
org: acmecorp
subjects: ["user:alice@acme.com"]
roleRef:
kind: GlobalRole
name: org-adminExample: a custom OrgRole
An OrgRole and an OrgRoleBinding that binds it:
apiVersion: core.ringleader.dev/v1
kind: OrgRole
metadata:
name: ci-bot
spec:
org: acmecorp
rules:
- apiGroups: ["workstations.ringleader.dev"]
resources: ["workstations"]
verbs: ["get", "list", "watch"]
- apiGroups: ["workstations.ringleader.dev"]
resources: ["workstations"]
verbs: ["create", "update", "delete"]
ownerScope: true
---
apiVersion: core.ringleader.dev/v1
kind: OrgRoleBinding
metadata:
name: acmecorp-ci
spec:
org: acmecorp
subjects: ["sa:acmecorp/ci"]
roleRef:
kind: OrgRole
name: ci-botWith this role, sa:acmecorp/ci reads every workstation in the organization, and creates, updates and deletes only the workstations it created.
Next steps
- Roles and grants: give someone a role, or write a custom organization role.
- Grant: the fields of a Grant, and the
cloudconfigright. - ServiceAccount and IdentityProvider: the non-human identities you bind these same roles to.