---
title: "Kafka Permissions - Pilot Docs"
description: "The Kafka ACLs Pilot's principal needs in standalone and HA mode"
url: "https://docs.calinora.io/configuration/kafka-permissions/"
---

# Kafka Permissions

This page applies when the Kafka cluster enforces ACLs. Grant the permissions to the principal Pilot connects with; see [SASL Authentication](https://docs.calinora.io/configuration/sasl/) and [TLS / SSL](https://docs.calinora.io/configuration/tls/).

Operations are named as in Apache Kafka’s [ACL model](https://kafka.apache.org/41/security/authorization-and-acls/). A distribution or managed service with its own authorizer can differ.

Pilot creates only its own topics, never deletes a topic or adds partitions, produces only to its own topics and joins no consumer group.

## Monitoring and plans

Standalone Pilot and the active replica in HA mode read with these permissions:

| Resource | Operations | Used for |
| - | - | - |
| Cluster | Describe | Partition moves in progress, log directories and disk usage, the ACL list |
| Cluster | DescribeConfigs | Broker configuration, topic defaults, throttle rates, the client quota list |
| All topics | Describe | Topics, partitions, replicas and ISR; offsets for partition activity and consumer lag. Kafka lists only the topics the principal may describe, so Pilot does not see the others |
| All topics, Kafka’s internal topics included | DescribeConfigs | Topic configuration, and the `min.insync.replicas` checks of plans, drains and the rolling restart. A topic the rolling restart cannot read refuses the broker’s stop |
| Consumer groups | Describe | The consumer group list, members, committed offsets and lag |
| Topics to browse | Read | The [message browser](https://docs.calinora.io/features/message-browser/), only when someone browses. Pilot’s own topics cannot be browsed |

## Applying changes

Changes need these permissions in addition, in both modes. A principal that only monitors needs none of them.

| Resource | Operations | Used for |
| - | - | - |
| Cluster | Alter | Partition moves and their cancel, preferred leader elections (also those of a rolling restart), log directory moves, ACL changes |
| Cluster | AlterConfigs | Client quota changes; broker throttle rates with throttle management |
| Topics | AlterConfigs | Topic configuration changes; throttled replica lists of moved topics with throttle management |
| Consumer groups | Read | Consumer group offset resets |
| Topics whose offsets are reset | Read | Consumer group offset resets |
| Consumer groups | Delete | Consumer group deletes |

With `PILOT_THROTTLE_MANAGED=true`, the default, Pilot needs both AlterConfigs permissions, on the cluster and on the moved topics. Grant both, or set `PILOT_THROTTLE_MANAGED=false`; see [Throttle Management](https://docs.calinora.io/features/reassignments/#throttle-management) and, for HA mode, [Replication throttles](https://docs.calinora.io/deployment/high-availability/#replication-throttles).

Alter on the cluster covers ACL changes, so the credential can change every ACL: protect it like an administrator credential.

## Pilot’s own topics

Standalone Pilot uses `__pilot_broker_state`, `__pilot_conditions`, the audit topic (`AUDIT_TOPIC`, default `__pilot_audit_log`) with `AUDIT_ENABLED=true`, the default, and `__pilot_pat_tokens` with personal access tokens. On each of them it needs:

| Operations | Used for |
| - | - |
| Describe, Read | Reading the topic from its start. Pilot uses no consumer group |
| Write | Writing its records. Standalone Pilot needs neither IdempotentWrite nor a transactional ID |
| Create | Creating the topic while Kafka lacks it |
| AlterConfigs | Setting the cleanup policy at each start, with the retention on the audit topic and the retention and segment time on `__pilot_conditions`. When Kafka refuses it, Pilot logs a warning and uses the topic as it is |

Pilot runs without `__pilot_conditions`; see [History Topic](https://docs.calinora.io/features/conditions/#history-topic).

HA mode adds the `__pilot_operations` topic, Kafka’s `__transaction_state` topic, the transactional ID `pilot-ha-<hash>` or the prefix `pilot-ha-`, and DescribeConfigs on Pilot’s own topics. [Kafka ACLs](https://docs.calinora.io/deployment/high-availability/#kafka-acls) lists their operations. In HA mode Pilot creates its topics, other than `__pilot_conditions`, only at the first start, and of its own topics it needs AlterConfigs only on `__pilot_conditions`. Standbys send no Kafka requests.

## Example

Grants for a standalone Pilot that connects as `User:pilot`:

```bash
# Monitoring and plans
kafka-acls.sh --bootstrap-server kafka-0.kafka:9093 --command-config client.properties --add \
  --allow-principal User:pilot --operation Describe --operation DescribeConfigs --cluster
kafka-acls.sh --bootstrap-server kafka-0.kafka:9093 --command-config client.properties --add \
  --allow-principal User:pilot --operation Describe --operation DescribeConfigs --topic '*'
kafka-acls.sh --bootstrap-server kafka-0.kafka:9093 --command-config client.properties --add \
  --allow-principal User:pilot --operation Describe --group '*'

# Applying changes
kafka-acls.sh --bootstrap-server kafka-0.kafka:9093 --command-config client.properties --add \
  --allow-principal User:pilot --operation Alter --operation AlterConfigs --cluster
kafka-acls.sh --bootstrap-server kafka-0.kafka:9093 --command-config client.properties --add \
  --allow-principal User:pilot --operation AlterConfigs --topic '*'
kafka-acls.sh --bootstrap-server kafka-0.kafka:9093 --command-config client.properties --add \
  --allow-principal User:pilot --operation Read --operation Delete --group '*'

# Message browser and offset resets: name the topics, or '*' for all
kafka-acls.sh --bootstrap-server kafka-0.kafka:9093 --command-config client.properties --add \
  --allow-principal User:pilot --operation Read --topic orders

# Pilot's own topics. The prefix covers the default AUDIT_TOPIC; grant a renamed one by name
kafka-acls.sh --bootstrap-server kafka-0.kafka:9093 --command-config client.properties --add \
  --allow-principal User:pilot --operation Read --operation Write --operation Create \
  --operation AlterConfigs --topic __pilot_ --resource-pattern-type prefixed
```

A principal that only monitors needs the grants under `# Monitoring and plans` and the grant for Pilot’s own topics.

HA mode needs these grants in addition. The `__pilot_` prefix grant covers `__pilot_operations` and gives more on Pilot’s topics than HA needs; [Kafka ACLs](https://docs.calinora.io/deployment/high-availability/#kafka-acls) lists the exact set:

```bash
kafka-acls.sh --bootstrap-server kafka-0.kafka:9093 --command-config client.properties --add \
  --allow-principal User:pilot --operation Describe --operation DescribeConfigs --topic __transaction_state
kafka-acls.sh --bootstrap-server kafka-0.kafka:9093 --command-config client.properties --add \
  --allow-principal User:pilot --operation Write --operation Describe \
  --transactional-id pilot-ha- --resource-pattern-type prefixed
```
