Skip to content

Identity & RBAC

Rune has a small, explicit auth model:

  • Subjects are users or services. Each subject has zero or more attached policies. Service subjects are non-human identities for CI/automation — see rune admin service.
  • Tokens are bearer credentials issued to subjects. They look like rune_<uuid>.<uuid>. The token’s secret hashes with SHA-256; only the hash is stored.
  • Policies are lists of rules. A rule grants (verbs) on (resource) in (namespace).

A request is allowed if any rule in any of the subject’s policies matches.

┌──────────────┐
Bearer token ──────▶ │ authFunc │ ── token lookup ──▶ subject_id
└──────┬───────┘
┌──────────────┐
resource + verb ────▶ │ rbac check │ ── policy eval ────▶ allow / deny
namespace └──────────────┘

If auth is disabled (auth.enabled: false in the runefile) the whole chain is bypassed. Don’t run that way in production.

name: editor-prod
description: Edit services in 'prod' namespace only
rules:
- resource: service
verbs: [get, list, watch, create, update, delete, scale, exec]
namespace: prod
- resource: secret
verbs: [get, list]
namespace: prod
FieldNotes
resourceResource type (service, instance, secret, configmap, namespace, …) or *.
verbsList of verbs or ["*"].
namespaceSpecific namespace or * or empty (treated as *).

Verbs map to RPCs:

VerbMaps to
getGet*
listList*
watchstreaming Watch* / StreamLogs
createCreate*, Cast*
updateUpdate*
deleteDelete*
scaleScale*, Restart*
execExec*
*All of the above

Seeded at first boot:

PolicyRule
root* on * in * — full access. Reserved for the bootstrap token.
admin* on * in *.
readwriteget/list/watch/create/update/delete/scale/exec on * in *.
readonlyget/list/watch on * in *.
castThe minimum permissions a CI pipeline needs to deploy: write services + read instances/logs.

Tokens are issued for a subject:

Terminal window
rune admin token create alice-laptop \
--subject-name alice \
--policies readwrite \
--ttl 720h

The plaintext secret is printed once. After that, only the SHA-256 hash is in the database.

PropertyNotes
NameHuman label.
SubjectIDThe user’s ID.
SubjectTypeuser for humans, service for CI/automation tokens (see rune admin service).
IssuedAtWhen minted.
ExpiresAtOptional — --ttl 0 for no expiry.
RevokedIf true, all requests fail.

Revoke immediately:

Terminal window
rune admin token revoke <token-id>

The very first call to a fresh server is AdminBootstrap. It’s the only RPC that doesn’t require auth. After it succeeds, all future calls need a token.

By default, all admin/* RPCs are gated to localhost on the server side. Toggle with auth.allow_remote_admin: true in the runefile. Don’t enable this on a public address without TLS.

Note: today, streaming RPCs (logs, exec, watch) bypass namespace-scoped policy rules — only * namespace rules apply to streams. Treat namespace-scoped policies as protection for write APIs, not stream APIs. This is tracked as a hardening item.

Some writes carry a privileged side-effect that’s encoded in the request body rather than the RPC name. Rune gates these behind extra verbs in addition to the standard one for the RPC:

VerbTriggered byEffect
storageclasses.set-defaultStorageClass.default: true on create / updateRequired on top of storageclasses.create / storageclasses.update.
services.privilegedsecurityContext.privileged: true or securityContext.seccompProfile.type: unconfined on the service or any init stepRequired on top of services.create / services.update. Without it the server returns PermissionDenied: access denied for resource: services verb: privileged.

The built-in readwrite policy grants the standard CRUD verbs on every resource but does not include set-default or privileged. Grant those to specific tokens or subjects (e.g. a platform-admin user managing the storage defaults, or a stateful-workload operator who needs seccomp=unconfined for an init step like TigerBeetle’s format) rather than handing out root.

name: auditor
rules:
- resource: "*"
verbs: [get, list, watch]
namespace: "*"
name: prod-deploy-bot
rules:
- resource: service
verbs: [get, list, watch, create, update, scale]
namespace: prod
- resource: secret
verbs: [get, list]
namespace: prod
- resource: configmap
verbs: [get, list, create, update]
namespace: prod
name: oncall-exec
rules:
- resource: service
verbs: [get, list, watch, exec]
namespace: "*"
- resource: instance
verbs: [get, list, watch, exec]
namespace: "*"
Terminal window
rune whoami # who am I and what policies do I have
rune admin user list
rune admin policy list
rune admin policy get readwrite
rune admin token list