Skip to Content
ConfigurationKafka Permissions

Kafka Permissions

This page applies when the Kafka cluster enforces ACLs. Grant the permissions to the principal Pilot connects with; see SASL Authentication and TLS / SSL.

Operations are named as in Apache Kafka’s ACL model . 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:

ResourceOperationsUsed for
ClusterDescribePartition moves in progress, log directories and disk usage, the ACL list
ClusterDescribeConfigsBroker configuration, topic defaults, throttle rates, the client quota list
All topicsDescribeTopics, 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 includedDescribeConfigsTopic 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 groupsDescribeThe consumer group list, members, committed offsets and lag
Topics to browseReadThe 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.

ResourceOperationsUsed for
ClusterAlterPartition moves and their cancel, preferred leader elections (also those of a rolling restart), log directory moves, ACL changes
ClusterAlterConfigsClient quota changes; broker throttle rates with throttle management
TopicsAlterConfigsTopic configuration changes; throttled replica lists of moved topics with throttle management
Consumer groupsReadConsumer group offset resets
Topics whose offsets are resetReadConsumer group offset resets
Consumer groupsDeleteConsumer 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 and, for HA mode, 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:

OperationsUsed for
Describe, ReadReading the topic from its start. Pilot uses no consumer group
WriteWriting its records. Standalone Pilot needs neither IdempotentWrite nor a transactional ID
CreateCreating the topic while Kafka lacks it
AlterConfigsSetting 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.

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 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:

# 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 lists the exact set:

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
Last updated on