Roles and access control
KCM decides what each account can see and do from its global role, its roles on environments and clusters, its fine-grained grants, and the role groups it belongs to. Access only adds up: there is no deny rule.
Global roles
Each account has one global role, set in Settings > Users.
| Role | What it can do |
|---|---|
ADMIN | Everything, on every resource. Only an ADMIN can change settings, SSO providers, trusted certificates and the license, give the ADMIN role, or manage another ADMIN account. KCM refuses to demote or disable the last enabled ADMIN. |
USER | Only what its roles and grants give. |
AUDITOR Team | Reads everything, administration and audit included, but changes nothing and never sees message or schema content. It counts as a VIEWER on every resource. |
SECURITY_ADMIN Enterprise | Manages users, service accounts and their tokens, role groups and grants everywhere, and reads the audit trail. It gets no Kafka data and no settings, and never touches an ADMIN account. |
Service accounts act through their roles and grants only, like a USER, unless you give them a
global role.
Limits of a security administrator
A SECURITY_ADMIN cannot:
- grant or change its own access, add itself to a role group, or add grants to a role group it belongs to;
- give the ADMIN role, or manage an ADMIN account (password, role, sessions, two-factor reset, tokens, enable or disable).
Creating a security administrator, or promoting a user to that role, needs the Enterprise edition.
Roles on resources
Three roles can be granted on an environment (a KCM group), a Kafka cluster, a
Kafka Connect cluster or a ksqlDB endpoint: VIEWER,
EDITOR and ADMIN.
| Role | On a Kafka cluster, it allows |
|---|---|
VIEWER | Browse topics and read messages, describe consumer groups, read connectors and schemas. |
EDITOR | Also every topic operation (create, alter, delete, produce), delete consumer groups and reset their offsets, change connectors, write schemas. |
ADMIN | Also edit or delete the cluster, add or delete its Kafka Connect clusters and ksqlDB endpoints, manage Kafka users, ACLs and client quotas, Schema Registry connections and global compatibility, partition reassignment and leader rebalancing, and grant access within the cluster (see delegated administration). |
Inheritance
- A role on an environment applies to every Kafka cluster in it.
- A role on a Kafka cluster applies to its Kafka Connect clusters, ksqlDB endpoints and Schema Registries.
- When several roles apply, the highest one wins.
An environment ADMIN can also edit the environment and create, edit or delete its clusters.
Fine-grained grants
Grants give a list of operations on resources matching a name or a prefix (LITERAL or
PREFIXED). They add access: a user with no role on a cluster can still see the topics
granted to it, and a role on the cluster already gives every resource of that cluster.
| Resource | Operations |
|---|---|
| Topics | READ, WRITE, DESCRIBE, CREATE,
DELETE, ALTER, ALL |
| Consumer groups | DESCRIBE, DELETE, RESET_OFFSETS,
ALL |
| Connectors | DESCRIBE, UPSERT (create, update, restore, reset offsets),
DELETE, CONTROL (pause, resume, restart, stop), ALL |
| Schema Registry subjects | DESCRIBE, CREATE, DELETE,
ALTER, ALL |
Each grant can be enabled or disabled and carries an optional description.
Before 1.4.0, grants restricted a cluster VIEWER or EDITOR to the granted resources. They now add access. The
API lists the users whose grants sit under a cluster role (and so no longer restrict them) in its log at each
start, and in GET /api/v1/authz/reports/grants.
Role groups
A role group bundles roles and grants, and gives them to all its members. Manage them in Settings > Role groups:
- name, description, color, enabled;
- members (users and service accounts);
- roles on environments, Kafka clusters and Kafka Connect clusters;
- topic, consumer group, connector and subject grants.
Only enabled role groups give access. My profile shows each user which role group grants each permission. Members can also come from your identity provider at each SSO sign in, see Role groups from identity provider groups Enterprise.
Delegated administration
Enterprise The ADMIN of an environment, a Kafka cluster or a Kafka Connect cluster can manage access within that scope, without being a global administrator:
- give, change and remove roles on that scope and below;
- manage topic, consumer group, connector and subject grants on that scope.
A delegated administrator sees only the grants of its scopes (and its own), never touches global roles, role groups or accounts, and cannot give more than ADMIN on its own scope. Without the Enterprise edition, scope ADMINs can still read these grants, but only global ADMINs and security administrators can change them.
Why does a user have access?
The explain API tells whether a user has a role on a resource, and where it comes from:
GET /api/v1/authz/explain?username=alice@example.com&resourceType=KAFKA_CLUSTERS&resourceId=12&permission=EDITOR,ADMIN
resourceType:KCM_GROUPS,KAFKA_CLUSTERS,KAFKA_CONNECT_CLUSTERSorKSQL_ENDPOINT;resourceId: the numeric id of the resource, as shown in the API answers and in the console URLs;permission: the accepted roles,VIEWER,EDITOR,ADMINby default.
{
"username": "alice@example.com",
"globalRole": "USER",
"resourceType": "KAFKA_CLUSTERS",
"resourceId": 12,
"permissions": ["EDITOR", "ADMIN"],
"allowed": true,
"grants": [
{ "source": "ROLE_GROUP:payments-team", "resourceType": "KCM_GROUPS", "resourceId": 3, "permission": "EDITOR" }
]
}
source is DIRECT, ROLE_GROUP:<name>, GLOBAL_ADMIN or
GLOBAL_AUDITOR, and the grant may sit on a parent (here, the environment of the cluster). Global
ADMINs, auditors and security administrators can ask about anyone; every user can ask about themselves.
The explain API covers roles. For a topic, use
GET /api/v1/authorizations/topic-permissions/check.
Manage access as code
Role groups, service accounts and role bindings can be declared in YAML, reviewed in Git and applied by a pipeline. Objects applied that way become read only in the console. See KCM as code.