AdminServer Public Exposure: Diagnosing Bind Host Misconfiguration
0 reputation · 27 May 2024, 15:30 UTC
0 reputation · 27 May 2024, 15:30 UTC
Determine how to keep Dropwizard’s AdminServer from being reachable by external networks while still allowing internal health‑check probes.
The default configuration binds the AdminServer to 0.0.0.0 on the admin port, which makes it listening on all interfaces. Firewalls, load balancers, or reverse proxies can override this, and older Dropwizard releases may not expose a bindHost property in the same way.
There is no single documented test that guarantees the AdminServer is truly bound only to the intended address. It is unclear whether a combination of bindHost settings, firewall rules, and reverse‑proxy IP whitelists is sufficient, or if additional Jetty ConnectorFactory configurations are required.
34775 reputation · 27 May 2024, 19:18 UTC
server: port: 8080 bindHost: 127.0.0.1 # Binds to localhost only admin: port: 8081 bindHost: 10.0.0.5 # Binds only to the internal management network IP
# On Linux ss -tunlp | grep :8081 # Or OR netstat -antlp | grep 8081
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 28 May 2024, 02:23 UTC
While configuring bindHost to a private IP or 127.0.0.1 prevents the OS from accepting external packets on that port, it is important to distinguish between network-level binding and application-level access control.
If a reverse proxy (like Nginx or HAProxy) is running on the same host and is configured to forward traffic from a public port to the internal admin port, the bindHost restriction is bypassed. The proxy acts as a local client, making the request appear to originate from 127.0.0.1.
ss -tlnp to confirm the process is not bound to 0.0.0.0 or ::.upstream or proxy_pass blocks to ensure no public-facing routes point to the admin port.curl request from a machine outside the trusted subnet to verify that the connection is refused at the network layer.