Skip to content
Opod

Security

Users, roles and SSO

Sign in with local users or your OIDC provider, the three roles, team scoping, machine tokens for automation, and retiring the bootstrap admin token.

Every /api/v1 call and the console's event stream need Authorization: Bearer <token>. A token is one of: a session from a local sign-in, a session from OIDC, a machine token (cpt-…), or the bootstrap admin token. Request bodies never carry credentials for these routes, and a URL never does.

In short

Right after install there is one way in: the bootstrap admin token from the chart's Secret. Give each person their own sign-in instead, either a local user or your company's SSO (OIDC), and give each program a machine token with one narrow scope. Each person gets a role (viewer, operator or admin), and a team if they should see only their team's endpoints. Connecting OIDC retires the shared token for people.

When you need it

  • A second person needs access: create a local user, or connect OIDC.
  • Your company signs in with Okta, Entra ID, Google, Keycloak or another OIDC provider.
  • A team must see and change only its own endpoints: give its users a team.
  • A CI job must deploy plans or mint keys: give it a machine token with plans:write or tokens:write.
  • Doctor's identity row is red.

Do it

  1. Read the bootstrap admin token

    kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d > admin.token
    H="Authorization: Bearer $(cat admin.token)"

    The Secret is <fullname>-admin. A release whose name contains opodcp uses that name as the full name, so release opodcp gives opodcp-admin; any other release gets <release>-opodcp-admin, for example prod-opodcp-admin.

  2. Create a local user

    curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/users \
      -d '{"name":"alice","password":"<a long password>","role":"operator","team":"search"}'

    Alice now signs in on the console with that name and password.

  3. Connect OIDC

    Register the redirect URL https://cp.example.com/api/v1/auth/oidc/callback with your provider. Then save the identity settings on the Connectors page, for example:

    OPODCP_OIDC_ISSUER        https://login.example.com/realms/acme
    OPODCP_OIDC_CLIENT_ID     opod
    OPODCP_OIDC_CLIENT_SECRET <client secret>
    OPODCP_OIDC_ROLE_MAP      opod-admins=admin,ml-ops=operator
    OPODCP_PUBLIC_URL         https://cp.example.com

    On 0.2.1 these are chart values instead: ports.identity.oidcIssuer, .oidcClientId, .oidcClientSecretRef, .oidcRoleMap, .oidcDefaultRole and .publicUrl.

  4. Give automation a machine token

    Machine tokens are new in 0.3.0.

    opodcp token create --scope plans:write --expires-in 2160h --cp https://cp.example.com --token "$(cat admin.token)" ci-deployer

    The token (cpt-…) is printed once. Store it in your CI's secret store.

Check it worked

curl -s -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/login \
  -d '{"name":"alice","password":"<a long password>"}' | jq '{name, role, team}'
# {"name":"alice","role":"operator","team":"search"}
curl -s https://cp.example.com/api/v1/auth/methods

A good answer: the login returns a token with the role and team you set, and auth/methods lists OIDC once it is connected. The console offers Sign in with SSO, and the account menu shows the user's name instead of static-admin. Doctor's identity row turns green once OIDC is connected.

If it fails

SymptomCauseFix
401 on every callthe token is wrong or expired, or it is sent in the URLsend Authorization: Bearer <token>; sign in again
401 credential_in_url?token= in a URLsend the header; for /events and downloads, use a stream ticket
403the role is too low, or the object belongs to another teaman operator or admin role; an unscoped user for cross-team work
429 on sign-in, with Retry-Aftermore than ten attempts at once from one addresswait; behind a proxy, list it in api.trustedProxies
409 on deleting a userit is the last admincreate another admin first
SSO redirects failthe redirect URL or OPODCP_PUBLIC_URL does not match what the provider hasregister exactly <public URL>/api/v1/auth/oidc/callback
Everyone signs in as viewerno group in OPODCP_OIDC_ROLE_MAP matches, or the groups are in another claimfix the map; set OPODCP_OIDC_ROLE_CLAIM
The control plane does not start after you cleared the admin Secretit needs OPODCP_ADMIN_TOKEN or OPODCP_BOOTSTRAP_ADMIN_PASSWORDrestore the Secret (see the warning below)

Roles

RoleMay
viewerread everything the caller's team may see
operatorcreate, change and delete endpoints, plans, rollouts, runs, keys, models, versions and jobs; acknowledge alerts
adminusers, machine tokens, the licence, connectors, alert rules, team quotas, model approval, machine actions, backup and restore, the audit chain

Every route declares its minimum role. GET /api/v1/openapi.json lists each operation with its role (x-opod-role) and scope (x-opod-scope).

Local users

curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/users \
  -d '{"name":"alice","password":"…","role":"operator","team":"search"}'
curl -s -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/login \
  -d '{"name":"alice","password":"…"}'          # → { token, name, role, team, expiresAt }

Passwords are stored as bcrypt hashes; sessions are server-side and last 24 h, and POST /api/v1/logout ends one. DELETE /api/v1/users/{id} also ends the user's sessions, and the last admin cannot be deleted (409). The console's Teams & quotas page manages users.

Sign-in is rate limited per client address: ten attempts at once, then one every six seconds; over it, 429 with Retry-After. A refused credential writes an auth.login_failed audit row with the name tried and the address, never the password. An unknown user costs the same hash comparison as a known one, and the answer is identical. Behind an Ingress, list the proxy's CIDRs in api.trustedProxies, so the client address comes from X-Forwarded-For of those peers only.

Single sign-on (OIDC)

Save these on the Connectors page (identity). On 0.2.1 they are chart values under ports.identity (oidcIssuer, oidcClientId, oidcClientSecretRef, oidcRoleMap, oidcDefaultRole, publicUrl). Any OIDC issuer works; sign-in uses the authorization code flow with PKCE.

SettingMeaning
OPODCP_OIDC_ISSUERthe issuer URL; its /.well-known/openid-configuration must be reachable from the pod
OPODCP_OIDC_CLIENT_IDthe client id
OPODCP_OIDC_CLIENT_SECRETstored sealed
OPODCP_OIDC_ROLE_MAPgroup=role,…, for example opod-admins=admin,ml-ops=operator
OPODCP_OIDC_DEFAULT_ROLEthe role of a user no group maps; default viewer
OPODCP_PUBLIC_URLthe console's URL as browsers see it, for redirects

Through extraEnv: OPODCP_OIDC_ROLE_CLAIM (the claim carrying groups; default groups), OPODCP_OIDC_TEAM_CLAIM (the claim naming the user's team; unset = unscoped), OPODCP_OIDC_REDIRECT_URL (default <public URL>/api/v1/auth/oidc/callback). Register that redirect URL with your provider.

What to set up at your provider — the client, the groups claim in the ID token for Keycloak, Okta and Entra ID, and what Verify checks — is in Connector setup → OIDC.

The console then offers Sign in with SSO. GET /api/v1/auth/methods says which methods are on. Local users keep working beside OIDC.

Retire the bootstrap token

The chart's admin.token is a bootstrap credential. Every action taken with it is audited as the same pseudo-user, static-admin, so the audit chain stays intact but says nothing about who acted. The doctor's identity row stays red while it works:

  • BOOTSTRAP: the shared admin token is the only way in — expected right after install.
  • SHARED ROOT BESIDE REAL USERS — people exist and the shared token still works.

Connecting OIDC retires the token: once an issuer is configured, the token no longer signs anyone in, and SSO is the way in. Without OIDC the token keeps working beside your local users, so that a mistyped password or a new colleague never locks anyone out, and the doctor row stays red to say so.

Do not just empty admin.token

Emptying admin.token and upgrading does not remove the token: the chart keeps the one it generated in Secret <release>-opodcp-admin. Clearing the token item in that Secret stops the control plane from starting at all (set OPODCP_ADMIN_TOKEN or OPODCP_BOOTSTRAP_ADMIN_PASSWORD), unless OPODCP_BOOTSTRAP_ADMIN_PASSWORD is set through extraEnv. Connect OIDC instead, and keep the Secret out of reach.

OPODCP_BOOTSTRAP_ADMIN_PASSWORD (through extraEnv) makes the control plane create a local user admin with that password at first start. It does not retire the token either: it is the same bootstrap credential in a second form.

Give automation a machine token with the narrowest scope, never a key to everything.

Teams

A user created with a team, or an OIDC user whose team claim names one, sees only that team's rows: endpoints, runs, jobs, keys, policies, alerts, audit rows, usage and the team's own quota. Another team's object answers 403 with a message that names neither the object nor its team. An endpoint a scoped operator creates lands in their team. Admins and users with no team are unscoped.

Team names are stored trimmed and lower-case, and an absent one is default. A team's GPU quota (PUT /api/v1/team-quotas, admin) is judged on new placements only.

Machine tokens

Machine tokens are new in 0.3.0. A machine token is a program's credential where a person would sign in. Every token reads as viewer; its one scope may add one narrow write:

ScopeAddsRoutes
viewer (default)nothing—
fleetthe fleet licence factPUT /api/v1/licence/fleet
tokens:writeissue and revoke endpoint keysPOST, DELETE /api/v1/endpoints/{id}/keys…
plans:writewrite plans and start rolloutsPUT /api/v1/endpoints/{id}/plan, POST /api/v1/endpoints/{id}/rollouts
opodcp token create --scope plans:write --expires-in 2160h --cp https://cp.example.com --token <admin token> ci-deployer
opodcp token ls
opodcp token revoke tok_1a2b3c4d5e6f

Tokens are kept as SHA-256 hashes and shown once. They do not expire unless you give --expires-in. A token carries no team, so a write scope acts on every endpoint of the cell. Its writes are audited as token:<name>. A program that needs two kinds of write holds two tokens. The console's Teams & quotas → Machine tokens card does the same.

Credentials never travel in a URL

?token= on any role-gated route is refused 401 credential_in_url, and its value is never read or logged. The four routes a browser drives without a header (GET /events, /api/v1/usage/export, /api/v1/audit/export, /api/v1/audit/chain) accept a single-use ticket instead: POST /api/v1/stream-ticket mints one that lives 30 s, carries the caller's identity, role and team, and is spent by the first request. Scripts send the header on those routes like any other.

API rate limit

api.rateLimit.rps and .burst (off by default) give every caller one token bucket, judged after the identity resolves. Over it, 429 rate_limited with Retry-After; no other caller is affected.

Last updated · Source: content/docs/control-plane-security/authentication.mdx · View as Markdown