docker-compose.yml sets ALLOWED_ADMIN_HOSTS but no code reads it #12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
While cleaning up the dead
ALLOWED_ADMIN_IPSenv var indocker-compose.yml(Task 14 of the network-access-control plan), I noticedALLOWED_ADMIN_HOSTSin the sameenvironment:block also has no consumer:routes_config.rshas a comment confirming this is intentional-ish: "Note: allowed_admin_hosts is intentionally absent — admin host is set via [admin] block" — so the admin host is configured through the TOML[admin]block instead, and this env var line indocker-compose.ymlis stale, same class of issue as theALLOWED_ADMIN_IPSline that was just removed.Out of scope for Task 14 (which only covered
ALLOWED_ADMIN_IPSfrom theallowed_ips→access_rulesmigration), so logging rather than fixing inline. Likely fix: remove theALLOWED_ADMIN_HOSTS=...line fromdocker-compose.yml'senvironment:block, same as was just done forALLOWED_ADMIN_IPS.Still live on
d3d7d1f. No code readsALLOWED_ADMIN_HOSTSanywhere insrc/, and it is still set in three shipped places:docker-compose.yml:52—ALLOWED_ADMIN_HOSTS=localhost,host.docker.internal(and again, commented, at :84).env.example:10makefile:3and:12Worse than cosmetic now, because of how the admin gate actually behaves:
middleware.rsonly applies the host/IP check when[[admin]]has entries, so with no[[admin]]block the admin API is reachable from any host with only API-key auth. An operator reading the shipped compose file reasonably concludes admin access is restricted to localhost. It is not restricted at all, and the variable that appears to do it is inert.So this should be fixed by deleting the variable from all three files, not by wiring it up —
[[admin]]withallow_ipsis the real control and a second mechanism would just be another thing to drift. The compose file should carry a commented[[admin]]example pointing at the TOML instead.Related: the empty-
[[admin]]-is-open asymmetry is the one place ER inverts its own secure-by-default rule and has no issue of its own.Fixed in
f46c037, before the v2.0.0 tag — and wider than this issue described.ALLOWED_ADMIN_IPSis equally inert and was set in.env.exampleand the makefile alongside the HOSTS one. It's the worse of the two, because it reads as the IP allowlist. Both are handled.Removed from
docker-compose.yml(both the live and commented blocks),.env.exampleand the makefile.docker-compose.ymlnow carries a comment pointing at[[admin]]withallow_ips, and noting that with no[[admin]]entry the admin API is open (#54).Deleting them from our own files only fixes our files, though — a deployment's existing compose would have gone on setting them silently, which is the actual defect. So both are now a hard startup error naming
[[admin]]/host/allow_ipsas the replacement, matching what ER does with every other removed setting. Breaking, which v2.0.0 already is.344 tests green, clippy clean, fmt clean. No test sets either variable.