You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
an embedded Jetty server that provides an HTTP interface to the four-letter
188
-
word commands. By default, the server is started on port 8080,
189
-
and commands are issued by going to the URL "/commands/\[command name]",
190
-
e.g., http://localhost:8080/commands/stat. The command response is
191
-
returned as JSON. Unlike the original protocol, commands are not
192
-
restricted to four-letter names, and commands can have multiple names;
193
-
for instance, "stmk" can also be referred to as "set_trace_mask". To
194
-
view a list of all available commands, point a browser to the URL
195
-
/commands (e.g., http://localhost:8080/commands). See the [AdminServer configuration options](#configuring-adminserver-for-ssltls)
196
-
for how to change the port and URLs.
197
-
198
-
The AdminServer is enabled by default, but can be disabled by either:
199
-
200
-
- Setting the zookeeper.admin.enableServer system
201
-
property to false.
202
-
- Removing Jetty from the classpath. (This option is
203
-
useful if you would like to override ZooKeeper's jetty
204
-
dependency.)
205
-
206
-
Note that the TCP four-letter word interface is still available if
186
+
**New in 3.5.0:** The AdminServer is an embedded Jetty server that provides an HTTP interface to the four-letter word
187
+
commands. In ZooKeeper releases 3.5.0 through 3.9.x, the AdminServer was enabled by default. Starting with ZooKeeper
188
+
3.10.0, the default configuration disables the AdminServer. When enabled, the server listens on port 8080 by default,
189
+
and commands are issued by accessing the URL `/commands/[command name]`, for example, `http://localhost:8080/commands/stat`.
190
+
Command responses are returned in JSON format.
191
+
192
+
Unlike the original protocol, commands are not restricted to four-letter names, and commands can have multiple aliases;
193
+
for example, `stmk` can also be referred to as `set_trace_mask`. To view a list of all available commands, access the
194
+
`/commands` endpoint (for example, `http://localhost:8080/commands`). See the AdminServer configuration options for
195
+
information on changing the port and URL mappings.
196
+
197
+
Beginning with ZooKeeper 3.10.0, the AdminServer is disabled by default and can be enabled by setting the
198
+
`zookeeper.admin.enableServer` system property to `true`. When enabled without additional configuration, the AdminServer
199
+
listens on all network interfaces (`0.0.0.0`), uses unencrypted HTTP, and does not require client authentication.
200
+
Administrators are strongly encouraged to restrict network access and configure appropriate transport security and
201
+
authentication before exposing the AdminServer in production environments.
202
+
203
+
Make sure that Jetty is available on the classpath, because the AdminServer will automatically remain disabled if Jetty
204
+
cannot be found. This behavior can be useful when overriding ZooKeeper's Jetty dependency.
205
+
206
+
Note that the TCP four-letter word interface is still available for monitoring purposes if
207
207
the AdminServer is disabled.
208
208
209
+
### Security Considerations
210
+
211
+
> **Important:** The AdminServer is disabled by default. When enabled without additional configuration,
212
+
> it listens on all network interfaces (0.0.0.0) on port 8080, uses unencrypted HTTP, and does not
213
+
> require client authentication. As a result, most administrative commands are accessible to any client
214
+
> that can reach the AdminServer. Administrators should restrict access appropriately and enable transport
215
+
> security and authentication when deploying the AdminServer in production.
216
+
217
+
### Default Security Posture
218
+
219
+
The default AdminServer configuration is intended for ease of use in trusted environments, but it is **not secure for
220
+
exposure to untrusted networks**.
221
+
222
+
Default settings include:
223
+
224
+
-`admin.enableServer=false`
225
+
-`admin.serverAddress=0.0.0.0`
226
+
-`admin.serverPort=8080`
227
+
-`admin.forceHttps=false`
228
+
-`admin.needClientAuth=false`
229
+
230
+
With these defaults:
231
+
232
+
- All traffic is transmitted in clear text over HTTP.
233
+
- Administrative data, including configuration and runtime details, can be viewed by anyone with network access.
234
+
- Many commands (such as `stat`, `srvr`, `conf`, and `cons`) do not require authentication.
235
+
- Sensitive operational information may be disclosed.
236
+
- In some environments, unrestricted administrative access can increase the impact of vulnerabilities or misconfiguration.
237
+
238
+
### Recommended Deployment Practices
239
+
240
+
Administrators should ensure that the AdminServer is accessible only to authorized users.
241
+
242
+
#### Option 1: Restrict Access with Firewall Rules (Minimum Recommendation)
243
+
244
+
Limit access to the AdminServer port to trusted hosts or management networks only.
245
+
246
+
Examples:
247
+
248
+
- Bind the server to localhost:
249
+
250
+
```properties
251
+
admin.serverAddress=127.0.0.1
252
+
```
253
+
254
+
- Use host-based firewall rules (such as `iptables`, `firewalld`, or cloud security groups) to allow access only from
255
+
- administrative systems.
256
+
257
+
This is the minimum recommended protection when HTTPS and client authentication are not enabled.
258
+
259
+
#### Option 2: Enable HTTPS
260
+
261
+
To encrypt all communication, configure SSL/TLS and force HTTPS:
262
+
263
+
```properties
264
+
admin.forceHttps=true
265
+
```
266
+
267
+
This prevents credentials and administrative data from being transmitted in clear text. ZooKeeper supports configuring
268
+
the AdminServer with TLS certificates and trust stores.
269
+
270
+
#### Option 3: Require Client Authentication
271
+
272
+
To restrict access to trusted clients using X.509 certificates:
273
+
274
+
```properties
275
+
admin.needClientAuth=true
276
+
```
277
+
278
+
When enabled, only clients presenting valid certificates trusted by the server will be allowed to connect.
279
+
280
+
### Recommended Secure Configuration
281
+
282
+
For production environments, the following configuration is strongly recommended:
283
+
284
+
```properties
285
+
admin.forceHttps=true
286
+
admin.needClientAuth=true
287
+
admin.serverAddress=<management-network-ip>
288
+
```
289
+
290
+
In addition, restrict access to the AdminServer port using firewall rules.
291
+
292
+
### Leave AdminServer disabled If Not Needed
293
+
294
+
If you do not use the AdminServer, disable it explicitly:
295
+
296
+
```properties
297
+
admin.enableServer=false
298
+
```
299
+
300
+
### Security Warning
301
+
302
+
Exposing the AdminServer to untrusted networks with the default configuration may allow unauthorized users to:
303
+
304
+
- Retrieve server configuration and runtime information
305
+
- Inspect connected clients and sessions
306
+
- Reset statistics
307
+
- Execute other administrative commands
308
+
309
+
Always protect the AdminServer with **network-level controls** and, preferably, **HTTPS with client certificate authentication**.
310
+
209
311
## Configuring AdminServer for SSL/TLS
210
312
211
313
- Generating the **keystore.jks** and **truststore.jks** which can be found in the [Quorum TLS](/admin-ops/administrators-guide/communication-using-the-netty-framework#quorum-tls).
0 commit comments