Skip to content

Commit 39edaa4

Browse files
authored
ZOOKEEPER-5050: Add enhanced documentation of Admin Server (branch-3.9)
Author: anmolnar Closes #2408 from anmolnar/ZOOKEEPER-5050_39
1 parent f6fb668 commit 39edaa4

1 file changed

Lines changed: 102 additions & 3 deletions

File tree

zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.md

Lines changed: 102 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2663,7 +2663,7 @@ command:
26632663

26642664
<a name="sc_adminserver"></a>
26652665

2666-
#### The AdminServer
2666+
### The AdminServer
26672667

26682668
**New in 3.5.0:** The AdminServer is
26692669
an embedded Jetty server that provides an HTTP interface to the four-letter
@@ -2688,7 +2688,106 @@ The AdminServer is enabled by default, but can be disabled by either:
26882688
Note that the TCP four-letter word interface is still available if
26892689
the AdminServer is disabled.
26902690

2691-
##### Configuring AdminServer for SSL/TLS
2691+
#### Security Considerations
2692+
2693+
> **Important:** The AdminServer is enabled by default and listens on all network interfaces (`0.0.0.0`) on port `8080`
2694+
> unless explicitly configured otherwise. By default, communication is **unencrypted (HTTP)** and **client authentication
2695+
> is disabled**. Most administrative commands can be executed by any client that can connect to the AdminServer.
2696+
2697+
#### Default Security Posture
2698+
2699+
The default AdminServer configuration is intended for ease of use in trusted environments, but it is **not secure for
2700+
exposure to untrusted networks**.
2701+
2702+
Default settings include:
2703+
2704+
* `admin.enableServer=true`
2705+
* `admin.serverAddress=0.0.0.0`
2706+
* `admin.serverPort=8080`
2707+
* `admin.forceHttps=false`
2708+
* `admin.needClientAuth=false`
2709+
2710+
With these defaults:
2711+
2712+
* All traffic is transmitted in clear text over HTTP.
2713+
* Administrative data, including configuration and runtime details, can be viewed by anyone with network access.
2714+
* Many commands (such as `stat`, `srvr`, `conf`, and `cons`) do not require authentication.
2715+
* Sensitive operational information may be disclosed.
2716+
* In some environments, unrestricted administrative access can increase the impact of vulnerabilities or misconfiguration.
2717+
2718+
#### Recommended Deployment Practices
2719+
2720+
Administrators should ensure that the AdminServer is accessible only to authorized users.
2721+
2722+
##### Option 1: Restrict Access with Firewall Rules (Minimum Recommendation)
2723+
2724+
Limit access to the AdminServer port to trusted hosts or management networks only.
2725+
2726+
Examples:
2727+
2728+
* Bind the server to localhost:
2729+
2730+
```properties
2731+
admin.serverAddress=127.0.0.1
2732+
```
2733+
* Use host-based firewall rules (such as `iptables`, `firewalld`, or cloud security groups) to allow access only from
2734+
* administrative systems.
2735+
2736+
This is the minimum recommended protection when HTTPS and client authentication are not enabled.
2737+
2738+
##### Option 2: Enable HTTPS
2739+
2740+
To encrypt all communication, configure SSL/TLS and force HTTPS:
2741+
2742+
```properties
2743+
admin.forceHttps=true
2744+
```
2745+
2746+
This prevents credentials and administrative data from being transmitted in clear text. ZooKeeper supports configuring
2747+
the AdminServer with TLS certificates and trust stores.
2748+
2749+
##### Option 3: Require Client Authentication
2750+
2751+
To restrict access to trusted clients using X.509 certificates:
2752+
2753+
```properties
2754+
admin.needClientAuth=true
2755+
```
2756+
2757+
When enabled, only clients presenting valid certificates trusted by the server will be allowed to connect.
2758+
2759+
#### Recommended Secure Configuration
2760+
2761+
For production environments, the following configuration is strongly recommended:
2762+
2763+
```properties
2764+
admin.forceHttps=true
2765+
admin.needClientAuth=true
2766+
admin.serverAddress=<management-network-ip>
2767+
```
2768+
2769+
In addition, restrict access to the AdminServer port using firewall rules.
2770+
2771+
#### Disable the AdminServer If Not Needed
2772+
2773+
If you do not use the AdminServer, disable it entirely:
2774+
2775+
```properties
2776+
admin.enableServer=false
2777+
```
2778+
2779+
#### Security Warning
2780+
2781+
Exposing the AdminServer to untrusted networks with the default configuration may allow unauthorized users to:
2782+
2783+
* Retrieve server configuration and runtime information
2784+
* Inspect connected clients and sessions
2785+
* Reset statistics
2786+
* Execute other administrative commands
2787+
2788+
Always protect the AdminServer with **network-level controls** and, preferably, **HTTPS with client certificate authentication**.
2789+
2790+
#### Configuring AdminServer for SSL/TLS
26922791
- Generating the **keystore.jks** and **truststore.jks** which can be found in the [Quorum TLS](http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#Quorum+TLS).
26932792
- Add the following configuration settings to the `zoo.cfg` config file:
26942793

@@ -2708,7 +2807,7 @@ ssl.quorum.trustStore.password=password
27082807
2019-08-03 15:44:55,403 [myid:] - INFO [main:JettyAdminServer@170] - Started AdminServer on address 0.0.0.0, port 8080 and command URL /commands
27092808
```
27102809

2711-
###### Restrict TLS protocols and cipher suites for SSL/TLS negotiation in AdminServer
2810+
#### Restrict TLS protocols and cipher suites for SSL/TLS negotiation in AdminServer
27122811

27132812
From 3.9.6 AdminServer uses the following already existing properties:
27142813

0 commit comments

Comments
 (0)