fix: allow dashboard host headers for trusted proxies#28954
fix: allow dashboard host headers for trusted proxies#28954eco-botfleet-audit wants to merge 1 commit into
Conversation
|
Hey @eco-botfleet-audit — there are several competing dashboard-host-allowlist PRs and I left similar notes on #25173, #27113, #28578. One observation specific to yours: The if bound_host in {"0.0.0.0", "::"}:
return True
if host_only in _normalize_allowed_hosts(allowed_hosts):
return True
# Loopback bind: ...
bound_lc = bound_host.lower()
if bound_lc in _LOOPBACK_HOST_VALUES:
...So when the operator binds to a specific non-loopback hostname like Things in this PR I think are stronger than mine:
I opened #29195 with a narrower env-var-only surface but with the loopback-only placement. If the maintainer prefers your richer config surface, the placement tweak alone would lock down the non-loopback-bind case. |
Summary
--allowed-host/dashboard.allowed_hostssupport for Hermes Dashboard Host-header validationWhy
Cloudflare Access / Tunnel deployments commonly terminate the public hostname at the edge while forwarding to a loopback dashboard origin. The dashboard's DNS-rebinding Host-header guard should keep rejecting arbitrary hostnames, but operators need a narrow, explicit allowlist for the public proxy hostname instead of using
--host 0.0.0.0 --insecureas a workaround.Operational driver: Oss Gruppen audit dashboard issue https://github.com/Oss-Gruppen-AS/enterprise-continuum/issues/450
Test plan
python -m pytest tests/hermes_cli/test_web_server_host_header.py tests/hermes_cli/test_dashboard_lifecycle_flags.py -qaudit-kanban.scheel.noorigin:Host: audit-kanban.scheel.noto127.0.0.1:9119/api/statusreturns 200Host: evil.examplereturns 400127.0.0.1:9119, not0.0.0.0:9119