Bind additional RBAC¶
What you will end up with¶
Role bindings that let actors other than you work in the organization and workspace you created, at organization or workspace scope.
Prerequisites¶
- An organization and a workspace. See Create your first organization and workspace.
- A role that permits
rbac.bindat the scope you are binding in.owner,admin,operator, anddeveloperall have it;viewerdoes not.
Binding model constraints¶
Bindings are additive. A binding is identified by its scope, its actor and
its role together. Binding viewer to someone who already has admin adds a
second grant; authorisation unions the roles, and admin still wins, so a
rebind raises access rather than lowering it.
Bindings are permanent. The binding API surface is two write endpoints:
A binding stands for the life of the scope.
Organization bindings reach every workspace. Workspace authorisation unions the actor's workspace roles with their roles in that workspace's organization, including workspaces created after the binding was written.
Bind at the narrowest scope with the narrowest role. Every binding is permanent.
The two scopes¶
One command, and the flag chooses the scope:
flowchart TB
B["xratu bind role <role> --to <actor>"]
B -->|"--organization acme"| O["org_rbac_binding<br/>reaches every workspace in acme"]
B -->|"--workspace payments"| W["rbac_binding<br/>reaches payments only"]
Passing both is refused by the CLI before any request is sent:
Passing neither falls back to the active workspace from your profile. An omitted flag produces a workspace binding, never an organization one.
1. Bind a person to a workspace¶
For an actor who works in one workspace:
Expected output¶
{
"status_code": 200,
"body": {
"status": "accepted",
"workspace_uuid": "b91d4f07-2c65-4e13-8a77-05ce9d2b6f38",
"actor_id": "user:bob@acme.example",
"role": "developer"
}
}
The response echoes what was written. The actor id is stored as given; step 5 confirms it resolves to a real principal.
2. Bind an administrator to the organization¶
For an actor who should reach every workspace, present and future:
3. Bind a group rather than a person¶
Groups arrive as token claims, so a group binding lets access follow your identity provider instead of being maintained per person:
The group name must be lowercase. Groups are lowercased when principals are built from claims:
group_name = str(group or "").strip().lower()
principals.append(group_name if group_name.startswith("group:") else f"group:{group_name}")
The binding is stored exactly as you typed it, and only the role is normalised.
A binding written as group:Platform-Engineering is therefore compared against a
principal of group:platform-engineering, matches nothing, and stands as a row
granting nothing. The same applies to user actors, whose emails are lowercased on
derivation.
4. Bind a service account¶
The CLI resolves the account name to its full actor form, so the workspace must be resolvable:
The stored actor id is service-account:<workspace_uuid>:<service_account_id>.
Creating the account is covered in
Create and manage a service account.
5. Verify¶
Verification is by effect. Three checks:
Have the bound actor list their scopes. A listing returns only scopes the actor holds a binding in, so a non-empty result is proof:
xratu auth --token "<their_access_token>" whoami
xratu config profile set bob --endpoint "${CP_CLI_ENDPOINT}" --token "<their_access_token>"
xratu config profile use bob
xratu get organizations
xratu get workspaces
These listings match actor_id literally, so they show bindings made to the
actor's own id. A group-bound actor is authorised and addresses the scope by
name, which is the check to use for step 3's binding.
Read the workspace audit. A workspace binding is recorded with its workspace, so it is retrievable:
The positional filters are actor, resource, and action in that order, so the two empty strings skip the first two.
Check an organization binding by effect. Audit is queried per workspace,
and the rbac.bind.organization record is keyed to the organization, so confirm
this binding by having the bound actor act or by reading back a resource the
binding permits:
Choosing the role¶
| Role | Bind it when | Note |
|---|---|---|
owner |
Written automatically at creation | Identical permissions to admin |
admin |
The actor should do anything at the scope | * |
operator |
Running the platform: tenancy, service accounts, runs, approvals | Covers platform operations |
developer |
Authoring: flows, capabilities, bindings, runs | Includes rbac.bind |
viewer |
Read-only review or compliance access | The one role that cannot escalate itself |
Both operator and developer include rbac.bind. An actor with either can
bind themselves a higher role at that scope. viewer is the one role that
cannot escalate.
If it fails¶
| Symptom | Cause | Fix |
|---|---|---|
403 forbidden: actor '...' cannot perform 'rbac.bind' |
You hold no role with rbac.bind at that scope |
Have an owner or admin bind it, or bind at a scope where you do |
bind role must target either organization or workspace scope, not both |
Both flags passed | Choose one |
service account not found: ci-publisher |
The account does not exist in the resolved workspace | Create it first, or correct --workspace |
organization not found by name or uuid: acme |
Resolution failed locally | The organization does not exist, or you cannot see it |
200 accepted but the actor still gets 403 |
Principal mismatch | Check case, and check the prefix form: user:, group:, sub: |
200 accepted but nobody gains anything |
The role name is outside the recognised five | See below |
Role names are matched at authorisation time, not at bind time. The service
lowercases the role and stores it as given. Authorisation then matches it against the five recognised names, and an unmatched
name resolves to an empty permission set.
xratu bind role developr --to user:bob@acme.example returns
"status": "accepted", grants nothing, and stands as a row. Confirm the spelling
against the role table above.
What changed¶
| Object | State |
|---|---|
rbac_binding or org_rbac_binding |
One row per bind, additive |
| Bound actors | Union of every role they hold at the scope |
| Audit | rbac.bind (workspace, retrievable) or rbac.bind.organization (organization, not retrievable) |
Next¶
Bootstrap authority grants the organization authority to enroll nodes.