klens

Privileges

What each klens privilege opens in the UI, the API, and MCP, and the Kafka permissions klens itself needs.

A privilege lets a signed-in user, or an MCP call, read one kind of data or make one kind of change. Roles grant privileges, and mcp.privileges sets the privileges of every MCP call. config.yaml names a privilege in snake case. /api/whoami returns it in screaming snake case, such as TOPIC_CONFIGS.

The catalog

Everyone who reaches a cluster sees its catalog, with no privilege:

  • Clusters and their health.
  • Topics, with partitions, replicas, watermarks, record counts, sizes, and produce rates.
  • Consumer groups, with members, committed offsets, and lag.
  • Brokers and their log dirs.
  • Schema subjects, with versions, schema IDs, types, and compatibility levels.
  • Search across topics, groups, brokers, and subjects.

Read privileges

PrivilegeOpens
recordsThe Data tab of a topic: record pages, single records, the NDJSON export, and the live tail. MCP klens_records_read and klens_record_get.
topic_configsThe Configuration tab of a topic. The configs of MCP klens_topic_describe.
broker_configsThe Configuration tab of a broker and the Quotas page. The configs of MCP klens_brokers_list with broker.
schema_textThe text of a schema version. MCP klens_schema_get.
aclsThe ACLs page and the Users page of SCRAM credentials. MCP klens_acls_list.

Write privileges

A write privilege works only on a cluster with writable: true. On any other cluster, the UI hides the action and the API answers 403 READ_ONLY_CLUSTER. The UI never offers a change to an internal topic.

PrivilegeAllowsIn the UI
create_topicsCreating a topic.Create topic on the topics page.
delete_topicsDeleting a topic.Delete topic on a topic.
alter_topic_configsSetting and removing topic config overrides.Editing a row on the Configuration tab of a topic.
add_partitionsRaising the partition count of a topic.Add partitions on a topic.
delete_recordsDeleting the records before an offset.Delete records on a topic or a record.
produceWriting a record.Produce record on a topic, and Duplicate this record on a record.
reset_offsetsMoving the committed offsets of a group, and planning a move.Reset offsets on a group.
delete_offsetsDeleting the offsets a group committed on a topic.Delete offsets on a group.
delete_groupsDeleting a group.Delete group on a group.
register_schemasRegistering a schema version.Register schema and Register a new version.
set_compatibilitySetting the compatibility level of a subject.Change compatibility on a subject.
delete_schemasDeleting a schema version or a subject.Delete this version on a subject.
create_aclsCreating ACL bindings.Create ACL on the ACLs page.
delete_aclsDeleting an ACL binding.Delete on an ACL row.
alter_quotasSetting and removing client quotas.Set quota, Edit quota, and Remove quota.
set_scram_credentialsAdding a SCRAM credential or replacing its password.Add user and Set password on the users page.
delete_scram_credentialsDeleting a SCRAM credential.Delete on a user row.
alter_broker_configsChanging a broker config or the cluster-wide default.Editing a row on the Configuration tab of a broker.

MCP accepts three write privileges: create_topics, produce, and register_schemas. Any other write privilege in mcp.privileges stops startup.

How klens combines roles

A user's privileges on a cluster are the union of every role bound to one of the user's groups on that cluster. A binding without clusters covers every cluster. A user who reaches a cluster through no binding does not see it, and the API answers 404 UNKNOWN_CLUSTER for it. Access control explains this model.

Without auth, and with auth but no roles, every user holds every privilege on every cluster.

Kafka permissions for klens

klens connects to Kafka as one Kafka user, set by sasl or a TLS client certificate. Kafka checks that user's ACLs on every request, whatever the klens role of the person who asked. Some pages need these Kafka permissions:

Page or dataKafka operationResourceWithout it
Sizes and log dirsDescribeClusterSizes stay blank. The rest of klens works.
ACLsDescribeClusterThe page says that klens's Kafka user needs DESCRIBE on the cluster.
SCRAM usersDescribeClusterThe page says that klens's Kafka user needs DESCRIBE on the cluster. Kafka 2.7 or later is also required.
QuotasDescribeConfigsClusterThe page says that klens's Kafka user needs DESCRIBE_CONFIGS on the cluster.
SCRAM credential changesAlterClusterKafka refuses the change.

klens also reads topics, groups, and configs, and makes the changes its users ask for, with the same Kafka user. When Kafka refuses such a request, the UI shows the error and the API answers REFUSED, ADMIN, or CLIENT.

On this page