Authorization and ACLs in Kafka: Deciding Who May Do What, on Which Topic, From Where

Authorization and ACLs in Kafka: Deciding Who May Do What, on Which Topic, From Where

Knowing who a user is does not tell you what they are allowed to do. Kafka Access Control Lists turn identities into precise permissions. This guide explains how ACLs work, how to design them, and how to avoid the mistakes that leave clusters open or applications locked out.

Picture a large office building. At the front desk, a guard checks your photo ID and hands you a badge with your name on it. That is a good start, but it does not mean you can walk into every room. The badge reader on the finance department door checks a list: “Is this person allowed in here?” The server room has a shorter list. The cafeteria has almost no restrictions. Someone must decide, room by room, who is on which list, and someone must keep those lists tidy as people join, move, and leave.

Apache Kafka works the same way. Verifying who you are is called authentication, and it is the guard at the front desk. Deciding what you may do once inside is called authorization, and in Kafka it is done with Access Control Lists, usually shortened to ACLs. Without them, anyone who can connect might read your payment events, delete your topics, or quietly change your cluster’s settings. In this tutorial we will start from the very beginning and build up, step by step, to the point where you can design, run, and troubleshoot ACLs in a real production environment, using plain language and everyday analogies along the way.

1Kafka Basics You Need First

A short refresher on the things that permissions are attached to.

Apache Kafka is a platform for storing and moving streams of events. An event is a small record of something that happened, such as an order being placed or a temperature being measured. Kafka stores these events in an ordered log so that many applications can read them, now or later.

Term 1

Broker

A Kafka server. Several brokers together form a Kafka cluster.

Term 2

Topic

A named category of events, such as “payments”. Think of it as a labelled folder of related messages.

Term 3

Producer

An application that writes events into topics.

Term 4

Consumer

An application that reads events from topics.

Term 5

Consumer Group

A team of consumers that share the work of reading a topic and remember their progress together.

Term 6

Client

Any program that connects to Kafka, including producers, consumers, stream processors, connectors, and administrative tools.

Why security matters more in Kafka than it first appears

Kafka is often the central nervous system of a company. Orders, payments, customer profiles, device readings, and internal alerts all pass through it. That makes it a very attractive target, and also a very easy place for accidents. A developer who mistakenly points a test program at the production cluster could publish garbage into a critical topic. A curious insider could read personal data they have no business seeing. A misbehaving script could delete a topic that took months to fill.

Simple Analogy

Think of Kafka as a huge shared post office where every department drops off and picks up mail. If the door is unlocked and there are no rules, anyone can read anyone’s mail, stuff fake letters into any pigeonhole, or throw a whole department’s mailbox in the bin. Security is what puts locks and sensible rules on that post office.

A cluster without authorization is fully open

By default, a fresh Kafka cluster has no authorizer switched on. That means every client that manages to connect can do absolutely everything. Access control is something you must deliberately turn on and configure, and this tutorial explains exactly what that involves.

2The Three Pillars of Kafka Security

Authorization is only one part of a bigger picture, and it depends on the other parts to work.

Pillar 1

Encryption

Scrambles data while it travels over the network, so eavesdroppers cannot read it. In Kafka this is done with TLS.

Pillar 2

Authentication

Proves who a client is. Kafka supports methods such as client certificates and several kinds of username and password or token based logins.

Pillar 3

Authorization

Decides what an authenticated client is allowed to do. In Kafka this is the job of ACLs.

flowchart LR
  A[Client connects] --> B[Encrypted channel with TLS]
  B --> C[Authentication proves identity]
  C --> D[Authorization checks each request]
  D --> E[Allowed request is processed]
  D --> F[Denied request is rejected]
        
FIG 1 — Every request passes through three protective layers in order

Why the order matters

Authorization can only work on an identity that it trusts. If a client can pretend to be anyone, then giving that identity permissions is meaningless, because an attacker will simply claim to be the most powerful user. Therefore authentication must come first, and it must be strong. Likewise, if traffic is not encrypted, someone on the network could steal login details or read data directly, making the permission checks pointless.

!
Critical Trap

If a listener accepts connections without authentication, every client appears to the broker as an anonymous user. ACLs may exist, but they can only distinguish “anonymous” from everyone else. Real per-application permissions are impossible without real authentication.

Simple Analogy

Encryption is the sealed envelope, authentication is the ID check at the door, and authorization is the list that says which rooms your ID opens. Remove any one of them and the building has a hole in it.

3What Is Authorization in Kafka?

The idea in one sentence, followed by what it really means in practice.

“Authentication asks who you are. Authorization asks what you are allowed to do.”

Authorization in Kafka is the process by which a broker decides, for every single request it receives, whether the client that sent the request has permission to perform the requested action on the requested resource. The broker checks a set of rules called Access Control Lists, or ACLs. If a matching rule permits the action, the request proceeds. If not, the broker returns an authorization error and does nothing.

What kinds of decisions does it make?

Can this application write to the payments topic?

Only the payment service should publish payment events. Everyone else should be refused, even if they can connect to the cluster.

Can this team read the customer profile topic?

Personal data should be visible only to teams with a business need. Reading is a separate permission from writing.

Can this user create or delete topics?

Deleting a topic destroys data. Such powers should belong to a small, trusted group, not to every developer.

Can this program change cluster settings?

Configuration changes can reduce durability or open security holes, so they need tight control.

Can this machine connect from this address?

ACLs can also restrict which network addresses a principal may use, adding a location check to the identity check.

Authorization is checked on every request

Kafka does not check permissions once when a client connects and then trust it forever. Each request, such as a produce request, a fetch request, or a request to create a topic, is checked as it arrives. This means a change to the ACLs takes effect quickly for clients that are already connected, without forcing them to reconnect.

Simple Analogy

A hotel key card does not simply open the door once and stay open. Each time you swipe it, the lock checks whether your card is still valid for that room. If the hotel cancels your access at midday, your next swipe fails.

4Who Is Asking? Principals and Identities

Every ACL rule begins with the question of who it applies to.

In Kafka, the identity of an authenticated client is called a principal. A principal is written with a type and a name, for example “User:alice” or “User:payment-service”. Almost all principals in Apache Kafka are of the type User, even when they represent an application rather than a human being.

Where the principal name comes from

The principal name is produced by the authentication step, and it depends on which method the client used.

Authentication MethodWhere the Name Comes FromThings to Watch
TLS client certificatesBy default, the full distinguished name inside the certificateNames can be long and awkward, so mapping rules are often used to shorten them to a clean identifier
SASL with username and passwordThe username used to log inPasswords must be stored and rotated safely
SASL with KerberosThe Kerberos principal, optionally reduced by translation rulesTranslation rules must be tested carefully
SASL with OAuth tokensA claim inside the token, commonly the subjectToken expiry and claim choice affect identity stability
No authenticationA fixed anonymous principalAll clients look identical, so ACLs cannot separate them

Mapping names into something readable

A certificate’s full distinguished name may look like a long string containing a common name, an organisational unit, and a country. Writing ACLs against such strings is error-prone and ugly. Kafka lets administrators define mapping rules that extract just the part that matters, such as the common name, so that ACLs can refer to a short, stable name like “User:orders-service”. Getting this mapping right is one of the most important early steps, because every ACL depends on it.

!
Common Mistake

Writing an ACL for the name you think the application has, while the broker actually sees a different string. The ACL exists, yet requests are denied, and the rule looks perfectly correct on paper. Always check the principal name that the broker really sees before writing rules.

i
One Principal per Application

Give each application or service its own identity rather than sharing one login across many programs. Shared identities make it impossible to grant minimal permissions, and impossible to tell from logs which program did what.

Simple Analogy

A company badge shows the employee’s name. If everyone shared one badge that said “Staff”, the door lists could only say “Staff may enter” or “Staff may not enter”. Individual badges let each door make a fair, precise decision.

5The Anatomy of an ACL

Every ACL is a small sentence with a fixed structure. Once you can read the sentence, you can read any ACL.

An ACL can be expressed as one plain English sentence: “Principal P is allowed or denied to perform Operation O on Resource R from Host H.” Each of those parts has a name, and together they form the rule.

Part 1

Principal

Who the rule is about, such as a specific user or application identity. A wildcard can mean every principal.

Part 2

Permission Type

Either allow or deny. Allow grants the action, and deny explicitly forbids it.

Part 3

Operation

The action, such as read, write, create, delete, or describe.

Part 4

Resource Type

The kind of thing being protected, such as a topic, a consumer group, or the cluster.

Part 5

Resource Name and Pattern

Which specific resources, given as an exact name, a prefix, or a wildcard.

Part 6

Host

The network address the request must come from. A wildcard means any address.

Reading a few example sentences

1

The payment service may write to the payments topic

Principal is the payment service, permission is allow, operation is write, resource is the topic named payments, host is any.

2

The reporting service may read the payments topic as part of its own group

Two rules are needed: read on the topic, and read on the consumer group that the reporting service uses.

3

Nobody but the platform team may delete any topic

Allow delete for the platform team’s principal, and rely on the absence of other allow rules to refuse everyone else.

4

The intern account may never read the customer topic, whatever else it is granted

A deny rule for the intern principal on the customer topic, which overrides any allow rules that might otherwise apply.

i
Read It Aloud

When reviewing ACLs, read each one aloud as a sentence. If the sentence sounds wrong, too broad, or confusing, the rule probably is. This simple habit catches a surprising number of mistakes.

6Resource Types: What Can Be Protected

Kafka lets you protect several kinds of things, and each has its own personality.

Resource 1

Topic

Protects reading and writing of events, and topic management actions such as creating, deleting, and altering settings.

Resource 2

Group

Protects consumer groups. Consumers need permission to join a group and commit their progress within it.

Resource 3

Cluster

Protects cluster-wide actions, such as creating topics in general, managing ACLs themselves, and broker-to-broker communication.

Resource 4

TransactionalId

Protects the identifiers used by transactional producers, so only authorised producers can use a given transactional identity.

Resource 5

DelegationToken

Protects delegation tokens, which are lightweight credentials that can be handed to short-lived processes.

Why groups deserve their own protection

Beginners often focus only on topics and forget consumer groups. A consumer needs read permission on the topic to fetch data, and read permission on its group to take part in the group and record its progress. Without the group permission, the consumer can be allowed to read data but still fails when it tries to join or commit. Groups also matter for safety: without group ACLs, a rogue client could join someone else’s group, steal partitions, and disrupt their processing.

Why the cluster resource is powerful

The cluster resource is a single, special resource that represents the cluster as a whole. Permissions here are very strong. For example, the ability to alter the cluster resource includes the ability to create and remove ACLs, which means it is effectively the power to change all the other rules. Such permissions should be given to very few identities.

!
Guard the Keys to the Kingdom

Whoever can change ACLs can grant themselves anything. Treat the permission to manage ACLs like a master key, hold it in a very small number of accounts, and monitor its use closely.

Simple Analogy

Topics are the rooms, groups are the meeting agendas inside some rooms, and the cluster is the building’s control panel. Access to a single room is common, but access to the control panel, which can reprogram every lock, must be rare.

7Operations: The Verbs of Kafka Security

An operation names the action being requested. Different resources accept different operations.

OperationWhat It AllowsTypical Resource
ReadFetching events, or joining and committing in a consumer groupTopic, Group
WritePublishing events, or using a transactional identityTopic, TransactionalId
CreateCreating topicsTopic, Cluster
DeleteDeleting topics, groups, or recordsTopic, Group
AlterChanging topic structure such as partitions, or managing ACLsTopic, Cluster
DescribeSeeing that a resource exists and reading its metadataTopic, Group, Cluster, TransactionalId
DescribeConfigsReading configuration settingsTopic, Cluster
AlterConfigsChanging configuration settingsTopic, Cluster
ClusterActionActions between brokers and controllers, such as replicationCluster
IdempotentWriteUsing the idempotent producer, required on the cluster in older versionsCluster
AllEvery operation applicable to the resourceAny

Implied permissions

Some operations automatically include others, which saves you from writing many rules. Read, write, delete, and alter each imply describe, because you cannot meaningfully read or write something you are not even allowed to see exist. Alter implies describe, and altering configs implies describing configs. Knowing these shortcuts keeps rule sets small and readable.

flowchart LR
  R[Read] --> D[Describe]
  W[Write] --> D
  DEL[Delete] --> D
  A[Alter] --> D
  AC[AlterConfigs] --> DC[DescribeConfigs]
        
FIG 2 — Stronger operations quietly include the matching describe permission
!
The All Operation Is a Blunt Instrument

Granting all operations is convenient, especially during development, but it hands over everything on that resource, including deleting it. Prefer the smallest set of specific operations each application actually needs.

Simple Analogy

In a library, “borrow”, “return”, “reorganise shelves”, and “burn the books” are different powers. A member may borrow, a librarian may reorganise, and nobody should be casually given the last one. Precise verbs let you give exactly the right power.

8Resource Patterns: Exact, Prefixed, and Wildcard

You rarely want to write one rule per topic. Patterns let a single rule cover many resources safely.

Pattern 1

Literal

Matches exactly one named resource, such as one specific topic. The safest and most precise option.

Pattern 2

Prefixed

Matches every resource whose name starts with a given text, such as all topics beginning with “orders-“.

Pattern 3

Wildcard

A special literal that matches every resource of that type. It is very powerful and should be used with great care.

Why prefixed patterns are a superpower

Imagine a team that owns dozens of topics, all named with the team’s prefix. Without prefixed rules, every new topic needs new ACLs. With a prefixed rule, one line grants the team the right to manage everything under their naming umbrella, present and future. This turns topic naming conventions into a security tool, which is why mature organisations agree on naming standards long before they write their first ACL.

Naming ConventionExample Topic NamesRule That Covers Them
team.application.entitysales.checkout.orders, sales.checkout.refundsOne prefixed rule for “sales.checkout.”
environment-domain-entityprod-billing-invoices, prod-billing-creditsOne prefixed rule for “prod-billing-“
Random unstructured namestopic1, mydata, new_stuffNo safe prefix, so rules must list each topic individually
!
Prefix Collisions

A prefix matches by text, not by meaning. A rule for the prefix “pay” would also cover a topic called “payroll-secrets”. Choose prefixes that end with a separator, such as a dot or a dash, so they match only what you intend.

Wildcards: handle with care

A wildcard resource rule applies to everything of that type, including topics that will be created in the future. Wildcards are often used for legitimate purposes, such as giving a platform administrator the ability to describe all topics, or for granting a monitoring tool read access to metadata. But an allow rule with a wildcard resource and a wildcard principal effectively switches security off for that operation, so such rules deserve a review and a written justification.

Simple Analogy

A literal rule is a key that opens one specific door. A prefixed rule is a key that opens all doors on the third floor, including rooms added later. A wildcard is a master key for the whole building. The more doors a key opens, the more careful you must be about who carries it.

9How the Broker Decides

When a request arrives, the authorizer follows a clear, predictable procedure.

flowchart TD
  A[Request arrives at the broker] --> B{Is the principal a super user}
  B -->|Yes| C[Allow]
  B -->|No| D{Does any matching deny rule exist}
  D -->|Yes| E[Deny]
  D -->|No| F{Does any matching allow rule exist}
  F -->|Yes| C
  F -->|No| G[Deny by default]
        
FIG 3 — The decision path for every authorization check
1

Super users skip the checks

Principals listed as super users in the broker configuration are always allowed. This is meant for the brokers themselves and a very small number of trusted administrators.

2

Deny rules win

If any rule that matches the principal, host, operation, and resource says deny, the request is refused, no matter how many allow rules also match.

3

An allow rule is needed

If no deny rule matches, the request is allowed only when at least one allow rule matches.

4

Otherwise, default deny

If nothing matches at all, the request is denied. This is the safe default and the reason why forgotten permissions show up as errors rather than as silent exposure.

The setting that flips the default

There is a broker setting, allow.everyone.if.no.acl.found, which changes step four. When it is true, a resource that has no ACLs at all is open to everybody. It exists mainly to ease migrations from an open cluster, and it is dangerous in production because any new topic, which starts with no ACLs, is instantly world-accessible. Leave it false, which is the default, in any environment that matters.

!
A Dangerous Convenience

Turning on the allow-if-no-ACL setting means every new topic starts fully open until someone remembers to lock it. Forgetting is inevitable, and the result is data exposed by default.

Using deny rules wisely

Because deny always wins, a deny rule is a powerful tool but also a source of confusion. A broad deny can silently cancel a carefully written allow. Most well-run clusters rely mainly on the default deny together with precise allow rules, and reserve explicit deny rules for rare exceptions, such as blocking one specific account from one specific sensitive topic.

Simple Analogy

A club doorman first checks if you are the owner, who is always let in. Then he checks the banned list, and if you are on it you are out, whatever else is true. Then he checks the guest list, and if you are not on it, you are out. Only names on the guest list who are not banned get in.

10Authorizers and Where ACLs Are Stored

The component that actually enforces the rules is called the authorizer, and it is pluggable.

Kafka does not hard-wire a single way of making authorization decisions. It defines an interface, and the broker configuration names the implementation to use through the setting authorizer.class.name. If this setting is empty, no authorization happens at all. If it names an implementation, the broker consults it for every request.

Built-in

ACL Authorizer for ZooKeeper-based clusters

The traditional implementation, which keeps ACLs in ZooKeeper and caches them in each broker’s memory.

Built-in

Standard Authorizer for KRaft clusters

The implementation used when the cluster manages its own metadata. ACLs are stored in the cluster’s metadata log and replicated to every broker.

External

Third-party authorizers

Plugins that consult an external policy engine or a central permission system, adding roles, groups, or richer policies.

Where the rules live

In older ZooKeeper-based clusters, ACLs are stored in ZooKeeper, which means ZooKeeper itself must be secured, or anyone with access to it could rewrite the rules. In newer KRaft-based clusters, ACLs live in the cluster’s own metadata log, and ZooKeeper is no longer part of the picture. Recent Kafka versions run only in the KRaft style, so new deployments use the standard authorizer.

flowchart LR
  A[Administrator creates an ACL] --> B[Metadata store]
  B --> C[Broker 1 cache]
  B --> D[Broker 2 cache]
  B --> E[Broker 3 cache]
  F[Client request] --> D
  D --> G{Check cached rules}
        
FIG 4 — ACLs are stored centrally and cached on every broker for fast checks

Fast decisions

Because every request needs a check, the rules are held in memory on each broker, so decisions take a tiny amount of time. When an administrator changes an ACL, the change propagates to all brokers within moments. Very large numbers of ACLs and very complex patterns can add overhead, which is another reason to prefer prefixed rules over thousands of individual ones.

i
Check Your Cluster Mode

Which authorizer class you configure depends on whether the cluster uses ZooKeeper or KRaft. Using the wrong class leaves the broker unable to start or unprotected, so confirm this against the documentation for your Kafka version before configuring.

11What Each Kind of Client Needs

The most practical question is: which ACLs does my application actually need?

ClientPermissions NeededNotes
Simple producerWrite on the topicDescribe is implied by write. Add create on the topic only if the producer is expected to create it.
Idempotent producerWrite on the topic, plus idempotent write on the cluster in older versionsNewer versions no longer need the cluster permission. Check your version.
Transactional producerWrite on the topic, and write and describe on its transactional identityThe transactional identity is its own resource.
ConsumerRead on the topic, and read on the consumer groupBoth are required. Missing the group permission is a very common cause of errors.
Kafka Streams applicationRead on input topics, write on output topics, read on the group named after the application, and create, read, write, and describe on the internal topics prefixed with the application namePrefixed rules keep internal topic permissions manageable.
Kafka Connect workerRead, write, create, and describe on its three internal topics, and read on its groupEach connector then needs its own permissions on data topics.
Sink connectorRead on the topics it copies, and read on the group named after the connectorThe group is typically named with a fixed prefix plus the connector name.
Source connectorWrite on the topics it fills, and create if it makes themTopic auto-creation must be allowed or topics pre-created.
Administrative toolingCreate, delete, alter, describe, and config operations as requiredKeep such accounts few, and separate from application identities.
Monitoring toolDescribe on topics and groups, and describe configsRead access to data is usually unnecessary for monitoring.
i
Convenience Shortcuts

The command-line ACL tool offers shortcut options for the common producer and consumer cases, which create the full set of required rules in one step. They are handy for learning and for standard cases, but always review what they generate before relying on them.

The classic surprise: consumer groups

New administrators frequently grant a consumer read on a topic and then find that the consumer still fails. The missing piece is almost always the read permission on the consumer group. The two permissions protect different things: the topic protects the data, and the group protects the coordination and progress tracking around it.

Simple Analogy

Being allowed into a library’s reading room is not the same as being allowed to sign the shared borrowing register. A reader needs both permissions to borrow books and have the loan recorded properly.

12Brokers, Super Users, and Internal Traffic

Kafka’s own servers talk to each other, and that traffic must be permitted too.

Brokers replicate data between themselves, controllers manage cluster metadata, and each of these actions is a request that passes through the authorizer, just like a client request. The brokers authenticate as a principal of their own, and that principal needs permission for the cluster-level actions used in replication and coordination.

Super users

The simplest and most common approach is to list the brokers’ principals as super users in the configuration. Super users bypass all ACL checks, so replication never fails because someone forgot a rule. The danger is that super users are all-powerful, so the list must be short and carefully protected.

Advantages of Super Users for Brokers

  • Simple and reliable for internal traffic
  • Prevents cluster failures caused by missing internal rules
  • Keeps ordinary ACL lists focused on applications

Risks to Manage

  • Anyone holding a super user identity can do anything
  • Broker certificates or credentials become extremely valuable
  • Super users leave no gap for fine-grained auditing of what they did
!
Never Use Super Users for Applications

It is tempting to make an application a super user to quickly silence authorization errors. Resist this. It permanently removes every safeguard for that application, and if its credentials leak, the attacker owns the entire cluster.

Keeping the broker identities safe

Because broker principals are so powerful, protect their credentials. Use dedicated certificates or logins that no application ever receives, restrict who can read the files holding them, rotate them on a schedule, and monitor for use of those identities from unexpected addresses.

Simple Analogy

The building’s maintenance crew has master keys because they must reach every room. The keys are held in a locked cabinet, signed out carefully, and never given to tenants, however politely they ask.

13Designing an ACL Strategy

Good access control comes from a plan, not from a pile of urgent fixes.

1

Agree on naming standards first

Decide how topics, groups, and transactional identities are named, including team and application prefixes. Every later step becomes easier.

2

Give every application its own principal

Create one identity per service, and name it clearly so logs and rules read naturally.

3

Start from deny and add only what is needed

Begin with no permissions, and grant exactly the operations each application requires on exactly its own resources.

4

Separate owners, writers, and readers

The team that owns a topic manages it. Other teams get read access on request, with a documented reason. Very few identities can write to another team’s topics.

5

Keep administrative power separate

Create dedicated administrative identities for topic management and ACL management, distinct from application identities, and restrict them tightly.

6

Review regularly

Schedule reviews to remove permissions for retired applications and departed staff, and to spot rules that have grown too broad.

flowchart TD
  A[Platform team] -->|manages ACLs and cluster| K[Kafka cluster]
  B[Team Sales] -->|owns and writes sales prefixed topics| K
  C[Team Billing] -->|owns and writes billing prefixed topics| K
  C -->|read only on selected sales topics| K
  D[Analytics team] -->|read only on approved topics| K
        
FIG 5 — Ownership by naming prefix, with narrow cross-team read access

Least privilege in practice

The principle of least privilege says every identity should hold only the permissions it truly needs, and no more. In Kafka this means a producer receives write on its topic but not read, a consumer receives read but not write, an application that never creates topics does not receive create, and no application receives permission to change ACLs or configuration.

Simple Analogy

A restaurant gives the waiter a key to the dining room and the till, the chef a key to the kitchen and the cold store, and the owner a key to the safe. Nobody gets every key just because it would be convenient.

14Managing ACLs at Scale

Typing rules by hand works for a demo. It does not work for hundreds of applications.

The command-line tool

Kafka ships with an ACL management tool that can add, remove, and list rules. It is ideal for learning, experiments, and emergency inspection. It connects to the cluster as an administrative principal, and it needs permission to alter the cluster resource to change rules and to describe it to list them.

Why manual management breaks down

Problem 1

No history

Nobody knows who added a rule, when, or why, so nobody dares remove it.

Problem 2

No review

A tired engineer during an incident can grant broad access with no second pair of eyes.

Problem 3

Drift

Different environments slowly develop different rules, so tests pass in staging and fail in production.

Problem 4

Orphans

Rules for retired applications remain forever, leaving unused doors unlocked.

Managing ACLs as code

Mature teams describe their desired ACLs in files kept in version control, and apply them through automated pipelines. Popular approaches include infrastructure-as-code tools, Kubernetes operators that treat users and their permissions as declarative objects, and dedicated topology management tools. The benefits are the same as for any code: every change is reviewed, history is preserved, environments stay consistent, and removing an application removes its permissions in the same change.

ApproachStrengthsWeaknesses
Manual command-line useQuick, no setup, good for learningNo review, no history, easy to drift
Scripts kept in version controlSimple, repeatableHard to remove stale rules, needs discipline
Infrastructure-as-code toolsDeclarative, reviewable, detects driftRequires tooling and state management
Kubernetes operatorsPermissions live beside application definitionsTies you to that platform
Self-service portal over automationTeams request access without waiting for a specialistNeeds approval workflows and upkeep
i
Make the Right Way the Easy Way

If requesting access through the automated pipeline is slower and harder than asking an administrator to run a quick command, people will bypass the pipeline. Design the process so that doing it properly takes minutes.

15Host-Based Restrictions

An ACL can ask not only who you are, but also where you are connecting from.

Each ACL includes a host field, which is the network address that the request must come from. The default and most common value is a wildcard meaning any address. But you can restrict a rule so that it applies only from a specific address, for example allowing an administrative account to change configuration only from a management network.

Administrative access from a jump host only

Even if the administrator’s credentials are stolen, the attacker cannot use them from anywhere except the designated management machine.

Production application from known servers

A sensitive producer identity is valid only from the addresses of its production servers, so a leaked certificate is useless on a laptop.

Limits of host rules

The host in an ACL is the address as seen by the broker. If clients connect through load balancers, network address translation, or proxies, the broker may see the address of the intermediary rather than the real client, making host rules meaningless or accidentally too broad. Addresses can also change in dynamic environments such as containers, where a fixed list of addresses is impractical.

!
Do Not Treat Host Rules as Strong Security

Host restrictions are a useful extra layer, not a substitute for strong authentication. Addresses can be spoofed or shared. Use them as a bonus, and rely on identities and least privilege as your main defence.

Simple Analogy

A bank might only accept a large transfer instruction if it arrives from the company’s registered office phone line. It is a helpful extra check, but the bank still wants proof of who is speaking.

16Auditing and Logging Decisions

Permissions are only trustworthy if you can see how they are being used.

The authorizer writes log entries about its decisions through a dedicated logger. Denied requests are recorded at a normal informational level, so they usually appear by default. Allowed requests are recorded at a more detailed level, and turning that on can produce a very large volume of logs, so it is usually enabled only for investigations or with careful sizing.

What a log entry tells you

1

The principal that the broker saw

This answers the first debugging question: is the identity what you expected?

2

The address the request came from

Useful for host rules and for spotting connections from unexpected places.

3

The operation and the resource

Shows exactly what was attempted, such as reading a specific topic or joining a specific group.

4

The decision

Whether it was allowed or denied, and often which rule caused the result.

Using logs for security, not just debugging

Ship authorizer logs to a central log system and set alerts for patterns worth noticing. A burst of denials from one principal can mean a misconfigured application or an attacker probing for weaknesses. Requests from a super user identity at unusual times or from unexpected addresses deserve immediate investigation. Changes to ACLs themselves should always generate an alert and an entry in the change record.

i
Denials Are Signals

A steady trickle of denied requests from a known application usually indicates a missing permission after a deployment. A sudden flood from an unknown source is a very different story. Learning what normal looks like lets you tell them apart.

17Common Errors and How to Read Them

Authorization failures show up as specific error types. Recognising them speeds up diagnosis enormously.

ErrorMeaningTypical Cause
Topic authorization failedThe principal lacks permission on a topic for the requested operationMissing read or write rule, wrong topic name, wrong prefix, or a wrong principal
Group authorization failedThe principal lacks permission on the consumer groupMissing read rule on the group, or the group name differs from what the application really uses
Cluster authorization failedThe principal lacks a cluster-level permissionAttempting topic creation without create, managing ACLs without alter, or older idempotent producer requirements
Transactional ID authorization failedThe principal cannot use that transactional identityMissing write or describe rule on the transactional identifier
Authentication failedThe identity could not be verified at allWrong credentials, expired certificate, or mismatched security protocol. This is not an authorization error.
!
Do Not Confuse the Two

Authentication failures mean “I do not know who you are”. Authorization failures mean “I know who you are, and you are not allowed”. Fixing the wrong one wastes hours, so check which of the two you are facing before changing anything.

A systematic checklist

1

Confirm the error type

Is it a topic, group, cluster, or transactional identifier problem? The type tells you which resource to inspect.

2

Find the principal in the broker log

Do not assume the name. Look at what the broker recorded for the denied request.

3

List the ACLs for that principal and resource

Check that a matching allow rule exists, with the right operation, pattern type, and host.

4

Look for a deny rule

A broad deny may be cancelling the allow you can see.

5

Check the implied requirements

Groups for consumers, internal topics for stream processors, transactional identifiers for transactions, and create permission for auto-created topics.

18The Limits of ACLs and What Lies Beyond

ACLs are simple and dependable, but they are not the answer to every access control need.

Strengths of Native ACLs

  • Built into Kafka, with nothing extra to install
  • Enforced on every request, and fast
  • Simple, explicit, and easy to reason about
  • Default deny is a safe starting point
  • Work with all standard clients and tools

Limitations to Plan For

  • No built-in roles or groups of users, so permissions attach to individual principals
  • Large organisations can accumulate very large rule sets
  • No conditions based on message content, such as fields or values
  • No built-in approval workflow or expiry dates
  • Limited native tooling for reporting who can access what

Options when ACLs are not enough

Option 1

Role-based access control

Some commercial and managed platforms add roles, so you grant a role to a person or team and the role carries a bundle of permissions.

Option 2

Policy engines and external authorizers

Plugins that ask a central policy service to decide, allowing richer, organisation-wide policies.

Option 3

Group mapping in the identity layer

Keep principals per application, and manage which humans may use which application credentials in your identity system.

Option 4

Data-level protection

Field-level encryption or masking for particularly sensitive values, so that even authorised readers see only what they should.

i
Content Is Not Covered

ACLs decide who can read a topic, not which records or fields inside it. If one topic mixes data of different sensitivity, anyone allowed to read it can read all of it. Separate topics by sensitivity, or protect the sensitive fields directly.

Simple Analogy

A door lock decides who may enter a room, not what they may look at once inside. If some papers in the room are secret, you either keep them in a separate room or put them in a locked drawer.

19Supporting Protections Around ACLs

ACLs work best as part of a wider defensive setup.

Layer 1

TLS everywhere

Encrypt client-to-broker and broker-to-broker traffic, so credentials and data cannot be intercepted.

Layer 2

Strong authentication

Use certificates, managed secrets, or tokens with rotation, and avoid shared or long-lived passwords.

Layer 3

Quotas

Limit how much traffic a principal can send or fetch, so one noisy or malicious client cannot exhaust the cluster.

Layer 4

Network segmentation

Keep brokers on private networks, allowing connections only from approved sources.

Layer 5

Secure the metadata store

In ZooKeeper-based clusters, protect ZooKeeper itself, since it holds the ACLs. In KRaft clusters, protect the controller endpoints.

Layer 6

Secret management

Store credentials and keys in a proper secret store, not in source code, chat messages, or plain configuration files.

Auto topic creation and ACLs

If automatic topic creation is enabled, a client that is allowed to create topics can produce new resources simply by mentioning a name. Combined with permissive rules, this can lead to topics appearing with unexpected names and no owner. Many organisations turn off automatic creation and create topics through a controlled process, together with their ACLs, so that every topic has a known owner from birth.

!
Credentials Are the New Perimeter

Since ACLs tie permissions to identities, anything that steals an identity steals its permissions. Rotate credentials, limit their lifetime where possible, and revoke them promptly when an application is retired or a person leaves.

20Design Patterns and Anti-Patterns

A few habits keep access control healthy, and a few habits quietly undermine it.

Helpful patterns

Pattern 1

Default deny, explicit allow

Keep the cluster closed by default, and grant narrowly scoped permissions on purpose.

Pattern 2

One identity per application

Enables minimal permissions and clear audit trails.

Pattern 3

Prefix by ownership

Use team and application prefixes so one rule grants a team control over its whole area.

Pattern 4

ACLs as code

Store, review, and apply rules through automated pipelines so history and drift are visible.

Anti-patterns to avoid

ANTI-PATTERN-01 Avoid
Problem

The team makes the application’s identity a super user because permission errors keep blocking deployments.

Why It’s Harmful

Every safeguard disappears for that application. A bug, a leaked credential, or a curious developer can now read, change, or delete anything in the cluster.

Correct Approach

Diagnose the specific missing permission from the error and the logs, then grant precisely that permission. Reserve super users for the brokers themselves.

ANTI-PATTERN-02 Avoid
Problem

One shared login is used by many applications and many people.

Why It’s Harmful

Permissions must be the union of everything anyone needs, so nobody has least privilege. Logs cannot show who did what, and a departing employee’s knowledge of the shared secret forces a risky mass rotation.

Correct Approach

Issue a separate identity to each application, and manage human access through your identity system.

ANTI-PATTERN-03 Avoid
Problem

The cluster runs with the allow-if-no-ACL setting turned on, or with wildcard allow rules for all principals.

Why It’s Harmful

New topics are open from birth, and the visible presence of ACLs creates a false sense of security while the cluster is effectively unprotected.

Correct Approach

Keep the default deny, remove wildcard allows for everyone, and audit periodically for broad rules.

ANTI-PATTERN-04 Avoid
Problem

Security is set up with ACLs but the listeners still allow unauthenticated connections.

Why It’s Harmful

Unauthenticated clients all look like the same anonymous principal, so either they are all denied, or someone grants that principal permissions and effectively opens the door to everyone who can reach the network.

Correct Approach

Require authentication on every listener that clients use, with TLS, and treat unauthenticated listeners as unacceptable outside isolated development.

ANTI-PATTERN-05 Avoid
Problem

Rules are added by hand during incidents, never documented, and never removed.

Why It’s Harmful

The rule set grows into an unexplained tangle. Nobody dares delete anything, stale permissions linger for retired applications, and audits become impossible.

Correct Approach

Manage ACLs as code, require review for every change, and schedule regular clean-ups of unused permissions.

ANTI-PATTERN-06 Avoid
Problem

Mixing highly sensitive and ordinary data in one topic, relying on ACLs alone.

Why It’s Harmful

Anyone who may read the topic reads everything in it. ACLs cannot separate records inside a topic.

Correct Approach

Split topics by sensitivity, or protect sensitive fields with encryption or masking before they enter Kafka.

21Real-World Scenarios

Here is how ACL thinking applies across different kinds of organisations.

Bank: separating payment processing from analytics

The payment service alone writes to payment topics. The fraud detection service reads them. The analytics team reads only a sanitised copy with account numbers masked. Deletion and configuration rights sit with a tiny platform group, and every ACL change goes through a reviewed pipeline.

Retailer: many teams on one shared cluster

Each product team owns a topic prefix and has write and read rights inside it. Cross-team access is granted as read-only on named topics after approval. Auto-creation is disabled, so every topic has an owner from the start.

Healthcare: protecting personal records

Topics carrying patient information are readable only by a short list of services with documented reasons. Denials and all access to these topics are logged centrally and reviewed regularly.

Software company: dev, test, and production clusters

The same ACL definitions are applied to each environment through automation, with tighter rules in production. Developers cannot use production credentials from their laptops, thanks to host restrictions and separate identities.

Platform team: onboarding a new application

A new service requests access through a pull request describing its topics, its consumer group, and its operations. Reviewers check the request against the naming standard, approve it, and the pipeline creates the identity and the rules together.

Partner integration: external consumers

An external partner receives its own identity with read access to exactly one outbound topic, from specific addresses, with a quota to protect the cluster. Its credentials have a limited lifetime and are rotated on schedule.

22A Troubleshooting Journey

Let us follow a realistic incident from the first complaint to a lasting fix.

A company deploys a new reporting service that reads from the “orders” topic. Immediately after launch, the service logs an authorization error and processes nothing. The developers insist the permissions were requested and granted.

1

Read the exact error

The message is a group authorization failure, not a topic failure. That is a strong hint: the read permission on the topic works, but something about the consumer group does not.

2

Confirm the principal the broker sees

The broker log shows the expected application identity, so authentication and name mapping are fine.

3

List the existing ACLs for that principal

There is a read rule on the orders topic, but no rule at all for consumer groups. The request that was approved only mentioned the topic.

4

Check which group name the application really uses

The configuration uses a group name with the environment appended, different from the name written in the access request. A rule for the wrong name would have failed too.

5

Apply the smallest correct fix

The team adds a read rule for the exact group name, through the reviewed pipeline, without touching anything else. The service starts consuming within moments, since ACL changes take effect on existing connections.

6

Prevent a repeat

They update the access request template to ask for topics, group name, and operations together, and add a pre-deployment check that compares the application’s configured names with its granted permissions.

The lesson is that authorization errors are precise messages. Reading them carefully, confirming the identity, and checking the implied resources such as groups solves most incidents in minutes, without ever needing to loosen security.

23Frequently Asked Questions

Q1What is the difference between authentication and authorization in Kafka?

Authentication proves who a client is, for example with a certificate or a login. Authorization decides what that authenticated client may do, using ACLs. Authorization depends on authentication being reliable.

Q2What is an ACL in Kafka?

An Access Control List entry is a rule stating that a principal is allowed or denied to perform an operation on a resource, optionally from a given host. The broker checks these rules for every request.

Q3What happens if I do not configure an authorizer?

No authorization is performed, and every client that can connect may do everything, including reading, writing, and deleting any topic. Access control must be enabled deliberately.

Q4What does a consumer need to read a topic?

Read permission on the topic and read permission on its consumer group. Missing the group permission is one of the most common causes of consumer authorization errors.

Q5What does a producer need to write to a topic?

Write permission on the topic. It also needs create permission if it is expected to create the topic, and transactional producers need permissions on their transactional identity. Older versions also required a cluster permission for idempotent writes.

Q6What happens when a deny rule and an allow rule both match?

Deny wins. If any matching rule denies the request, it is refused regardless of allow rules.

Q7What is a super user?

A principal listed in the broker configuration that bypasses all ACL checks. It is typically used for the brokers themselves and should be extremely limited.

Q8What is the difference between literal and prefixed ACLs?

A literal ACL matches exactly one named resource. A prefixed ACL matches every resource whose name begins with a given text, which makes it ideal for team or application naming conventions.

Q9Can I create groups of users or roles in native Kafka ACLs?

Not natively. ACLs attach to individual principals. Some platforms add role-based access control, and external authorizers can provide richer models. Otherwise, manage groupings in your identity system or automation.

Q10Do ACL changes require restarting brokers or clients?

No. Changes propagate to brokers quickly and apply to subsequent requests, including those from already connected clients.

Q11Can ACLs restrict access to certain records or fields in a topic?

No. ACLs control access at the level of topics, groups, and other resources. To protect sensitive fields, separate them into different topics or protect them with encryption or masking.

Q12Why does my ACL exist but requests are still denied?

Common reasons are a principal name that differs from what the broker sees, a wrong resource name or pattern type, a missing related permission such as the consumer group, a host restriction that does not match, or a deny rule that overrides your allow.

Q13Should I enable the setting that allows access when no ACL is found?

Not in production. It makes every resource without ACLs open to everyone, including every newly created topic. It is sometimes used temporarily while migrating an open cluster, and should be switched off as soon as ACLs are in place.

Q14How should I manage ACLs for many applications?

Treat them as code. Keep desired rules in version control, review changes, and apply them with automation such as infrastructure-as-code tools or operators, so that history, consistency, and clean-up are built in.

Q15What is the single most important habit for Kafka authorization?

Follow least privilege with default deny: give each application its own identity and only the exact permissions it needs, and manage those permissions in a reviewed, automated, and audited way.

24Summary and Key Takeaways

Authorization in Kafka answers the question of what an authenticated client may do. It is implemented with Access Control Lists, each of which states that a principal is allowed or denied to perform an operation on a resource from a host. The broker checks these rules on every request, follows a clear decision path in which super users pass, denies win, an allow is required, and everything else is refused, and keeps the rules cached for speed.

Strong results come from combining ACLs with encryption and real authentication, giving every application its own identity, using naming conventions with prefixed rules, granting only the operations each client needs, remembering the implied resources such as consumer groups and internal topics, keeping super users to the brokers alone, managing rules as reviewed code, and watching the authorizer logs. Understand the limits too: ACLs do not provide roles and cannot protect individual fields inside a topic.

Key Takeaways

  • Authorization is separate from authentication — authentication proves identity, and ACLs decide what that identity may do, so both must be strong and enabled.
  • An ACL is a simple sentence — a principal, allow or deny, an operation, a resource with a pattern, and a host; read every rule aloud to check it makes sense.
  • The decision path is predictable — super users are allowed, any matching deny wins, an allow is required, and everything else is denied by default.
  • Know what each client really needs — consumers need read on topic and group, stream processors need internal topic permissions, transactional producers need transactional identity access.
  • Least privilege beats convenience — one identity per application, narrow operations, prefixed ownership rules, and no super users, wildcards, or allow-if-no-ACL shortcuts in production.
  • Manage ACLs like code — version control, review, automated application, regular clean-ups, and alerts on any change to the rules themselves.
  • Watch and understand the limits — audit denials and privileged use, and remember ACLs cover resources, not record contents or user roles, so separate sensitive data and add roles or policy engines when needed.