-
Notifications
You must be signed in to change notification settings - Fork 7.3k
ZOOKEEPER-5050. Enhance documentation of AdminServer to highlight security considerations #2389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
anmolnar
wants to merge
2
commits into
apache:master
Choose a base branch
from
anmolnar:ZOOKEEPER-5050
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+102
−3
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2694,7 +2694,7 @@ command: | |
|
|
||
| <a name="sc_adminserver"></a> | ||
|
|
||
| #### The AdminServer | ||
| ### The AdminServer | ||
|
|
||
| **New in 3.5.0:** The AdminServer is | ||
| an embedded Jetty server that provides an HTTP interface to the four-letter | ||
|
|
@@ -2719,7 +2719,106 @@ The AdminServer is enabled by default, but can be disabled by either: | |
| Note that the TCP four-letter word interface is still available if | ||
| the AdminServer is disabled. | ||
|
|
||
| ##### Configuring AdminServer for SSL/TLS | ||
| #### Security Considerations | ||
|
|
||
| > **Important:** The AdminServer is enabled by default and listens on all network interfaces (`0.0.0.0`) on port `8080` | ||
| > unless explicitly configured otherwise. By default, communication is **unencrypted (HTTP)** and **client authentication | ||
| > is disabled**. Most administrative commands can be executed by any client that can connect to the AdminServer. | ||
|
|
||
| #### Default Security Posture | ||
|
|
||
| The default AdminServer configuration is intended for ease of use in trusted environments, but it is **not secure for | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't we err on the side of security instead? (see prev line comment) |
||
| exposure to untrusted networks**. | ||
|
|
||
| Default settings include: | ||
|
|
||
| * `admin.enableServer=true` | ||
| * `admin.serverAddress=0.0.0.0` | ||
| * `admin.serverPort=8080` | ||
| * `admin.forceHttps=false` | ||
| * `admin.needClientAuth=false` | ||
|
|
||
| With these defaults: | ||
|
|
||
| * All traffic is transmitted in clear text over HTTP. | ||
| * Administrative data, including configuration and runtime details, can be viewed by anyone with network access. | ||
| * Many commands (such as `stat`, `srvr`, `conf`, and `cons`) do not require authentication. | ||
| * Sensitive operational information may be disclosed. | ||
| * In some environments, unrestricted administrative access can increase the impact of vulnerabilities or misconfiguration. | ||
|
|
||
| #### Recommended Deployment Practices | ||
|
|
||
| Administrators should ensure that the AdminServer is accessible only to authorized users. | ||
|
|
||
| ##### Option 1: Restrict Access with Firewall Rules (Minimum Recommendation) | ||
|
|
||
| Limit access to the AdminServer port to trusted hosts or management networks only. | ||
|
|
||
| Examples: | ||
|
|
||
| * Bind the server to localhost: | ||
|
|
||
| ```properties | ||
| admin.serverAddress=127.0.0.1 | ||
| ``` | ||
| * Use host-based firewall rules (such as `iptables`, `firewalld`, or cloud security groups) to allow access only from | ||
| * administrative systems. | ||
|
|
||
| This is the minimum recommended protection when HTTPS and client authentication are not enabled. | ||
|
|
||
| ##### Option 2: Enable HTTPS | ||
|
|
||
| To encrypt all communication, configure SSL/TLS and force HTTPS: | ||
|
|
||
| ```properties | ||
| admin.forceHttps=true | ||
| ``` | ||
|
|
||
| This prevents credentials and administrative data from being transmitted in clear text. ZooKeeper supports configuring | ||
| the AdminServer with TLS certificates and trust stores. | ||
|
|
||
| ##### Option 3: Require Client Authentication | ||
|
|
||
| To restrict access to trusted clients using X.509 certificates: | ||
|
|
||
| ```properties | ||
| admin.needClientAuth=true | ||
| ``` | ||
|
|
||
| When enabled, only clients presenting valid certificates trusted by the server will be allowed to connect. | ||
|
|
||
| #### Recommended Secure Configuration | ||
|
|
||
| For production environments, the following configuration is strongly recommended: | ||
|
|
||
| ```properties | ||
| admin.forceHttps=true | ||
| admin.needClientAuth=true | ||
| admin.serverAddress=<management-network-ip> | ||
| ``` | ||
|
|
||
| In addition, restrict access to the AdminServer port using firewall rules. | ||
|
|
||
| #### Disable the AdminServer If Not Needed | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we could flip this (see prev comments) and say to enable if needed? |
||
|
|
||
| If you do not use the AdminServer, disable it entirely: | ||
|
|
||
| ```properties | ||
| admin.enableServer=false | ||
| ``` | ||
|
|
||
| #### Security Warning | ||
|
|
||
| Exposing the AdminServer to untrusted networks with the default configuration may allow unauthorized users to: | ||
|
|
||
| * Retrieve server configuration and runtime information | ||
| * Inspect connected clients and sessions | ||
| * Reset statistics | ||
| * Execute other administrative commands | ||
|
|
||
| Always protect the AdminServer with **network-level controls** and, preferably, **HTTPS with client certificate authentication**. | ||
|
|
||
| #### Configuring AdminServer for SSL/TLS | ||
| - 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). | ||
| - Add the following configuration settings to the `zoo.cfg` config file: | ||
|
|
||
|
|
@@ -2739,7 +2838,7 @@ ssl.quorum.trustStore.password=password | |
| 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 | ||
| ``` | ||
|
|
||
| ###### Restrict TLS protocols and cipher suites for SSL/TLS negotiation in AdminServer | ||
| #### Restrict TLS protocols and cipher suites for SSL/TLS negotiation in AdminServer | ||
|
|
||
| From 3.10.0 AdminServer uses the following already existing properties: | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given these issues why wouldn't this be disabled by default?