Kafka Security Part 2: ACLs, Authorization, Quotas and Hardening Checklist

Apache Kafka 17 min min read Updated: Nov 17, 2026 Advanced
Kafka Security Part 2: ACLs, Authorization, Quotas and Hardening Checklist
Advanced Topic 2 of 2

Enable the Authorizer

text # broker.properties (KRaft) authorizer.class.name=org.apache.kafka.metadata.authorizer.StandardAuthorizer super.users=User:admin;User:broker allow.everyone.if.no.acl.found=false # default deny: no ACL means no access
Default deny: After enabling the authorizer with allow.everyone.if.no.acl.found=false, every action needs an explicit ACL (super users excepted). Create ACLs for all applications before switching on, or you will cut them off.

What an ACL Contains

An ACL says: Principal P is Allowed/Denied to perform Operation O on Resource R from Host H.

PartValues
PrincipalUser:orders-service (from SASL username or certificate mapping)
Resource typeTopic, Group (consumer group), Cluster, TransactionalId, DelegationToken
PatternLITERAL (exact name) or PREFIXED (all names starting with a prefix)
OperationRead, Write, Create, Delete, Alter, Describe, DescribeConfigs, AlterConfigs, IdempotentWrite, ClusterAction, All
PermissionAllow or Deny (deny wins over allow)
Host* or a specific IP

Recipes

Producer that writes to shop.orders.created.v1 (with idempotence):

bash bin/kafka-acls.sh --bootstrap-server $BS --command-config admin.properties --add \ --allow-principal User:orders-service --producer --topic shop.orders.created.v1 # the --producer shortcut grants Write, Describe and Create on the topic, and IdempotentWrite on the cluster

Consumer in group email-service reading the topic:

bash bin/kafka-acls.sh --bootstrap-server $BS --command-config admin.properties --add \ --allow-principal User:email-service --consumer --topic shop.orders.created.v1 --group email-service # grants Read and Describe on the topic and Read on the group

Team namespace with prefixed ACLs, so a team can manage its own topics:

bash bin/kafka-acls.sh --bootstrap-server $BS --command-config admin.properties --add \ --allow-principal User:payments-team --operation All --topic payments. --resource-pattern-type prefixed bin/kafka-acls.sh --bootstrap-server $BS --command-config admin.properties --add \ --allow-principal User:payments-team --operation All --group payments- --resource-pattern-type prefixed

Transactional producer needs rights on its transactional.id:

bash bin/kafka-acls.sh --bootstrap-server $BS --command-config admin.properties --add \ --allow-principal User:order-processor --operation Write --operation Describe --transactional-id order-processor-1

Inspect and Remove

bash bin/kafka-acls.sh --bootstrap-server $BS --command-config admin.properties --list bin/kafka-acls.sh --bootstrap-server $BS --command-config admin.properties --list --principal User:orders-service bin/kafka-acls.sh --bootstrap-server $BS --command-config admin.properties --remove --allow-principal User:old-app --operation All --topic old.topic # deny rule example (blocks a specific host) bin/kafka-acls.sh --bootstrap-server $BS --command-config admin.properties --add --deny-principal User:analytics --operation Read --topic shop.payments --deny-host 10.0.9.9

Least-Privilege Practice

  • One principal per application (not a shared account) so you can audit and revoke
  • Give producers only Write, consumers only Read, and keep admin rights with a few people and automation
  • Use prefixed ACLs for team topics, literal ACLs for sensitive topics
  • Keep ACLs in code (Terraform, Strimzi KafkaUser, scripts) and review them like any other change
  • Keep the number of super users minimal, and protect their credentials

Client Quotas

Quotas protect the cluster from clients that send or fetch too much, or create too many requests. They can be set per user, per client id, or both.

bash bin/kafka-configs.sh --bootstrap-server $BS --command-config admin.properties --alter \ --add-config 'producer_byte_rate=20971520,consumer_byte_rate=41943040,request_percentage=25' --entity-type users --entity-name orders-service bin/kafka-configs.sh --bootstrap-server $BS --command-config admin.properties --alter \ --add-config 'controller_mutation_rate=10' --entity-type users --entity-name payments-team # limits topic and partition creation rate

Audit Logging

  • Authorizer decisions are logged at INFO/DEBUG level in kafka-authorizer.log (configure log4j2). Denials are most important
  • Request logs (kafka.request.logger) show who sent what
  • Forward logs to a central system and alert on repeated authorization failures or unexpected principals
  • For compliance, add an external audit layer or use a platform that provides audit events

Hardening Checklist

AreaAction
NetworkPrivate subnets, firewall rules allow only needed ports (9092 from app subnets, 9093 only between controllers and brokers), no public IPs
EncryptionTLS 1.2 or higher on all listeners including controller and inter-broker. Disk encryption on data volumes
AuthenticationSASL or mTLS for every client, no anonymous access
AuthorizationAuthorizer on, default deny, least privilege ACLs, few super users
SecretsNo passwords in plain config files. Use secrets managers, config providers, short-lived credentials
Topicsauto.create.topics.enable=false, creation policy, quotas
SoftwareSupported Kafka and Java versions, security patches applied in rolling fashion
HostDedicated OS user, minimal permissions on data and config directories, SSH restricted
MonitoringAlerts on auth failures, certificate expiry, unusual traffic, new ACLs
DataDo not put raw secrets or unnecessary personal data in events. Use field encryption or tokenisation for sensitive fields
Test as the application: After creating ACLs, test with the application's own credentials: produce, consume, describe the group. Missing Describe or Group Read permissions are the most common surprises.

Conclusion

Enable the authorizer with default deny, create one principal per application, grant only the needed operations (using --producer and --consumer shortcuts and prefixed ACLs), add quotas, log authorization decisions and follow a hardening checklist.

Quick Summary: StandardAuthorizer + default deny; --producer/--consumer ACLs; prefixed team ACLs; quotas; audit.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators