Skip to main content
XenonStack

Continuous Security

XenonStack Insights Apache ZooKeeper Security: Kerberos, ACLs and TLS

and | Published | Updated

ZooKeeper security guide: controlled znode access, ACLs per znode, Kerberos SASL and TLS, patched supported release

Securing Apache ZooKeeper means deciding who can connect to the ensemble, who can read or change each znode, and how traffic between clients and servers is protected. According to the ZooKeeper client-server authentication guide, Kerberos is used through SASL with the GSSAPI mechanism, and the server and each client load a JAAS file that names a principal and a keytab. ACLs then limit what each identity can do on a znode.

This guide is for platform and security leads who run ZooKeeper under Hadoop, HBase, Solr or older Kafka estates. It sets out the Kerberos steps the project documents, the ACL, quorum and TLS controls around them, and what to check on versions and advisories. For how ZooKeeper itself works, read Apache ZooKeeper: architecture, ACLs and setup. For Kafka metadata and KRaft, see Kafka and ZooKeeper architecture.

What does ZooKeeper security cover?

ZooKeeper holds small but critical data: configuration, leader state and locks. A user who can write to it can change how the systems above it behave, so the controls below should be treated as layers, not alternatives.

LayerWhat it protectsDocumented control
Client authenticationWho may open a sessionSASL with Kerberos (GSSAPI), set with authProvider.1 and a JAAS Client section
Server-to-server authenticationWho may join the quorumquorum.auth.enableSasl, with QuorumServer and QuorumLearner JAAS sections
AuthorisationWhat an identity may do on a znodeACLs with CREATE, READ, WRITE, DELETE and ADMIN permissions
Transport protectionTraffic on the wireTLS through secureClientPort and sslQuorum
ExposureWhich commands and ports are reachable4lw.commands.whitelist and network controls

Sources: client-server authentication, server-server authentication and the administrator's guide, read 13 November 2026.

How do you set up Kerberos authentication on a ZooKeeper server?

The project guide describes four server-side steps. First, create a service principal for each server host in the form zookeeper/hostname and a keytab for it, using your Kerberos administration tools. Second, add a Server section to a JAAS file. Third, enable the SASL provider in zoo.cfg. Fourth, point the server JVM at the JAAS file.

JAAS Server section, as shown in the guide (the path and host name are placeholders):

Server {
       com.sun.security.auth.module.Krb5LoginModule required
       useKeyTab=true
       keyTab="/path/to/server/keytab"
       storeKey=true
       useTicketCache=false
       principal="zookeeper/yourzkhostname";
};

In conf/zoo.cfg, the guide sets the provider, and in java.env it passes the JAAS file to the JVM:

authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider

SERVER_JVMFLAGS="-Djava.security.auth.login.config=/path/to/server/jaas/file.conf"

The guide notes that the keytab should not be readable by anyone other than the ZooKeeper server process user. It also lists two optional server settings, kerberos.removeHostFromPrincipal and kerberos.removeRealmFromPrincipal, which are commented out by default and which the administrator's guide documents with a default of false.

How does a client authenticate?

A client needs its own keytab and a Client section in a JAAS file, with the JVM flag set through CLIENT_JVMFLAGS in java.env. According to the guide, SASL is on by default for clients and can be turned off with -Dzookeeper.sasl.client=false. If the server principal is not zookeeper/hostname, the client can be told the user part with zookeeper.sasl.client.username, or the full principal with zookeeper.server.principal, which the guide says works in 3.5.7+ and 3.6.0+.

What happens when authentication fails?

By default, a client that fails SASL authentication is disconnected immediately. The guide says this can be relaxed with zookeeper.maintain_connection_despite_sasl_failure set to yes, which weakens the control and is not advised for production. To go further, sessionRequireClientSASLAuth (default false, from 3.6.0) requires clients to authenticate with SASL before a session is established.

Two further notes from the guide. A login thread periodically refreshes the credentials on client and server, so tickets do not lapse silently, and the addauth command has no effect for the SASL scheme. Under FIPS mode the administrator's guide says only GSSAPI (Kerberos) is available for SASL.

XenonStack's walkthrough video shows the same flow in a lab:

Video: How to Secure Apache Zookeeper with Kerberos (XenonStack, YouTube). Commands in the video may use older paths, so follow the current project guide above.

How do you secure traffic between ZooKeeper servers?

Quorum peers can authenticate each other with SASL. The server-server guide lists three settings in zoo.cfg, all defaulting to false:

Two-column diagram mapping ZooKeeper exposures (anonymous clients, unauthenticated peers, open znodes, plain-text traffic) to controls (Kerberos SASL, quorum SASL, ACLs per znode, TLS).
SettingWhat the guide says
quorum.auth.enableSaslEnables quorum authentication using SASL
quorum.auth.learnerRequireSaslLearners send an authentication packet to peer servers; the guide says it can be used during upgrades
quorum.auth.serverRequireSaslIf true, all unauthenticated quorum peer learner connection requests are rejected

The JAAS file gets QuorumServer and QuorumLearner sections, each with a Krb5LoginModule, a keytab and a principal. The guide says a single shared principal (servicename/localhost) does not support authorisation, whereas a host-based principal (servicename/_HOST) does: ZooKeeper replaces _HOST with each server's FQDN from the server.id entries, each host needs its own keytab, and servers accept only learners whose host name is in the ensemble list. It states that the feature is supported from 3.4.10.

How do ACLs limit what an authenticated user can do?

Authentication proves identity, and ACLs decide what that identity may do. According to the programmer's guide, ACLs are not recursive: an ACL on a parent does not apply to its children, so each znode that matters needs its own.

PermissionAllows
CREATECreating a child node
READGetting data from a node and listing its children
WRITESetting data for a node
DELETEDeleting a child node
ADMINSetting permissions

The guide lists these built-in schemes: world (anyone), auth (the current authenticated user), digest (a username and password hash), ip (the client address) and x509 (the client's X500 principal). For SASL logins, the administrator's guide describes zookeeper.superUser as a way to name a user with super access to the znode tree, so keep that identity tightly held. The same guide describes zookeeper.skipACL under unsafe options: it skips ACL checks and, in its words, opens full access to the data tree to everyone, so never set it in production.

How do you add TLS to a ZooKeeper ensemble?

The administrator's guide describes TLS in addition to SASL, not instead of it. Kerberos proves who is connecting, while TLS protects the bytes. The settings below are from the guide, read 13 November 2026.

SettingWhat the guide saysSince
secureClientPortPort for TLS client connections; set alongside clientPort for mixed mode3.5.5
serverCnxnFactorySet to NettyServerCnxnFactory for TLS-based server communication3.5.5
sslQuorumEnables encrypted quorum communication; default false3.5.5
ssl.clientAuthAuthenticates TLS client connections (none, want or need; default need)3.5.5
ssl.hostnameVerificationDefault true3.5.5
4lw.commands.whitelistDefault is srvr only; * enables all four-letter commands3.5.3

The guide also describes upgrading an existing non-TLS cluster with no downtime, which is the safer path for a live ensemble. Take certificate and key store settings (ssl.keyStore.* and ssl.trustStore.*) from the guide for your release.

Which ZooKeeper versions and advisories should you check?

The releases page lists 3.9.7 as current and 3.8.8 as the latest stable release, and marks 3.7.2 as end of life since 2 February 2024. The security page lists fixes in 3.8.8 and 3.9.7, and its titles include a SASL authorisation bypass on the client port through a client-supplied authorisation ID, an ACL enforcement bypass after an ACL revocation, and several denial-of-service issues. Affected version ranges differ between a few entries' headers and descriptions, so confirm each range and the CVE record on the official page before planning an upgrade.

Related guides: see the Apache Storm security with Kerberos and HBase security with Kerberos guides for two systems that depend on a secured ZooKeeper.

What should an enterprise do first?

StepActionWhy first
1. InventoryList every system that depends on the ensemble, and which release it runsYou cannot secure or patch what you have not mapped
2. PatchMove to a supported release and read the security pageRecent advisories cover SASL and ACL handling
3. AuthenticateEnable SASL with Kerberos for clients, then the quorumCloses anonymous access
4. AuthoriseSet ACLs on the znodes that matter, not only the rootACLs are not recursive
5. EncryptAdd TLS using the no-downtime upgrade pathProtects data on the wire
6. Reduce exposureRestrict ports and keep the 4lw whitelist narrowLimits what an attacker can query

When is Kerberos not the right answer?

Kerberos needs a working KDC, correct DNS and clock agreement, and keytab hygiene. If a small team lacks that operations capacity, the guide documents DIGEST-MD5 as an alternative SASL mechanism, with the trade-off that the JAAS file then holds plain-text passwords and must be locked down. FIPS-mode deployments cannot use DIGEST-MD5 at all.

Where does ZooKeeper security fit in governed enterprise AI?

Coordination services sit underneath the data platforms that AI agents depend on, so their access controls are part of governing what an agent can reach. They do not record why an agent acted. ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents, and AgentGRC keeps autonomous agent actions inside policy, with the audit trail risk teams need. See also zero trust security architecture for the wider control model.

Key takeaways on ZooKeeper security

Use Kerberos for identity, ACLs for authorisation per znode, SASL for quorum peers and TLS for transport, keep the ensemble on a supported release, and confirm every setting on the project guide for your version.

Next Steps

Talk to our experts about implementing compound AI system, How Industries and different departments use Agentic Workflows and Decision Intelligence to Become Decision Centric. Utilizes AI to automate and optimize IT support and operations, improving efficiency and responsiveness.

To map one decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.

Frequently asked questions

What is Apache ZooKeeper used for?

It is a coordination service for distributed systems. It handles configuration, naming, synchronisation and leader election for platforms such as Hadoop and HBase.

How does Kerberos secure ZooKeeper?

Clients and servers authenticate through SASL with the GSSAPI mechanism, using Kerberos principals and keytab files named in a JAAS file, so only identities the Kerberos realm recognises can open a session.

What are ZooKeeper ACLs?

Access control lists set permissions on each znode: CREATE, READ, WRITE, DELETE and ADMIN. They are not recursive, so each znode needs its own.

Is Kerberos enough on its own?

No. Combine it with ACLs, quorum authentication, TLS for transport and a restricted four-letter-word whitelist, and keep the release patched.

Can ZooKeeper servers authenticate each other?

Yes. Setting quorum.auth.enableSasl to true, with QuorumServer and QuorumLearner JAAS sections, enables SASL between quorum peers from release 3.4.10.

Take Next Steps

Talk to our experts about implementing compound AI system, How Industries and different departments use Agentic Workflows and Decision Intelligence to Become Decision Centric. Utilizes AI to automate and optimize IT support and operations, improving efficiency and responsiveness.

Ready to put AI agents to work? See an ElixirClaw demo: the agentic OS to build, orchestrate and govern AI agents across your enterprise systems.

Table of Contents

navdeep-singh-gill

Navdeep Singh Gill

Global CEO and Founder of XenonStack

LinkedIn profile

Navdeep Singh Gill is serving as Chief Executive Officer and Product Architect at XenonStack. He holds expertise in building SaaS Platform for Decentralised Big Data management and Governance, AI Marketplace for Operationalising and Scaling. His incredible experience in AI Technologies and Big Data Engineering thrills him to write about different use cases and its approach to solutions.

Get the latest articles in your inbox

Subscribe Now

Interested in solving your challenges with the XenonStack team?
Get Started

Tell us about you and your priorities so we can prepare the right conversation. It takes about 2 minutes.

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Continue