Authorization (RBAC)
Authorization determines what an authenticated principal can do. Danube uses Role-Based Access Control (RBAC) with scoped bindings and default-deny semantics. If no policy explicitly grants access, the request is denied.
The authorization model has three building blocks:
A Binding connects a Principal to a Role at a specific Scope. The Role bundles one or more Permissions, and the Scope determines where those permissions apply: across the entire cluster, within a single namespace, or on a specific topic.
- Permissions: individual actions like
Produce,Consume, orManageTopic - Roles: named bundles of permissions (e.g., a
producerrole grantsLookup+Produce) - Bindings: attach a role to a principal at a specific scope
Permissions
Section titled “Permissions”Danube defines 9 permissions:
| Permission | Description | Typical Use |
|---|---|---|
Lookup | Discover topic metadata and partitions | Required for producers and consumers |
Produce | Publish messages to a topic | Producers |
Consume | Subscribe and receive messages | Consumers |
Replicate | Replicate data between brokers | Reserved for future cross-cluster replication |
ManageNamespace | Create, delete, and configure namespaces | Namespace administrators |
ManageTopic | Create, delete, and configure topics | Topic administrators |
ManageSchema | Register and manage schemas | Schema administrators |
ManageBroker | Broker operations (unload topics, etc.) | Cluster operators |
ManageCluster | Cluster-wide operations (Raft, security policies) | Super administrators |
Scoped Bindings
Section titled “Scoped Bindings”Bindings can be attached at three scope levels:
| Scope | Applies to | Example |
|---|---|---|
| Cluster | All resources in the cluster | Global admin access |
| Namespace | All topics within a namespace | /payments/* |
| Topic | A specific topic only | /payments/orders |
When evaluating a request, the authorizer checks bindings from the most specific scope to the broadest:
- Topic-level bindings (if the resource is a topic)
- Namespace-level bindings (for the topic’s namespace)
- Cluster-level bindings
If any matching binding grants the required permission, the request is allowed. If no binding matches, the request is denied.
Managing Roles
Section titled “Managing Roles”Roles are named collections of permissions.
# Producer role: can look up and publish to topicsdanube-admin security roles create producer-role \ --permissions Produce,Lookup
# Consumer role: can look up, subscribe, and receive messagesdanube-admin security roles create consumer-role \ --permissions Consume,Lookup
# Namespace admin roledanube-admin security roles create ns-admin-role \ --permissions ManageNamespace,ManageTopic,ManageSchema,Lookup
# Full cluster admin roledanube-admin security roles create cluster-admin-role \ --permissions ManageCluster,ManageBroker,ManageNamespace,ManageTopic,ManageSchema,Lookup,Produce,Consume# List all rolesdanube-admin security roles list
# Get details of a specific roledanube-admin security roles get producer-role
# JSON output (for scripting)danube-admin security roles list --output json
# Delete a roledanube-admin security roles delete producer-roleManaging Bindings
Section titled “Managing Bindings”Bindings connect principals to roles at a specific scope. Each binding has a unique ID.
# Cluster-scoped: grant producer-role to a service accountdanube-admin security bindings create b-payments-writer \ --principal-type service_account \ --principal-name payments-writer \ --roles producer-role \ --scope cluster
# Namespace-scoped: grant consumer-role on /analyticsdanube-admin security bindings create b-analytics-reader \ --principal-type service_account \ --principal-name analytics-reader \ --roles consumer-role \ --scope namespace \ --resource /analytics
# Topic-scoped: grant producer-role on a specific topicdanube-admin security bindings create b-orders-writer \ --principal-type service_account \ --principal-name orders-service \ --roles producer-role \ --scope topic \ --resource /payments/orders
# Multiple roles in one bindingdanube-admin security bindings create b-platform-admin \ --principal-type user \ --principal-name admin-user \ --roles cluster-admin-role,ns-admin-role \ --scope cluster# List by scopedanube-admin security bindings list --scope clusterdanube-admin security bindings list --scope namespace --resource /paymentsdanube-admin security bindings list --scope topic --resource /payments/orders
# Get a specific bindingdanube-admin security bindings get b-payments-writer --scope cluster
# Deletedanube-admin security bindings delete b-payments-writer --scope clusterdanube-admin security bindings delete b-analytics-reader --scope namespace --resource /analyticsSuper-Admins
Section titled “Super-Admins”For initial cluster bootstrap and emergency access, Danube supports super-admins, which are JWT subjects that bypass RBAC entirely. Super-admins are declared in the broker configuration, not through the RBAC system.
auth: super_admins: - "admin"A super-admin can perform any operation on any resource without needing roles or bindings.
Next Steps
Section titled “Next Steps”For a complete walkthrough from certificate generation to client connection, see the Securing a Cluster guide.