Fix HostAuthorization blocking k8s probes and Tailscale hostname #232
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "231-fix-host-authorization"
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?
Summary
PR #230 added
config.hosts << "landscaping-assistant.app"which enabled HostAuthorization with only one allowed host. k8s probes hit the pod IP directly and get 403, causing CrashLoopBackOff. Tailscale hostname is also blocked.Changes
config/environments/production.rb— add Tailscale prod and dev hostnames toconfig.hosts; exclude/upfrom HostAuthorization so health probes always passdocs/networking.md— add Allowed Hosts section documenting every entry inconfig.hostsand when to updateTest Plan
landscaping-assistant.tail5b443a.ts.netandlandscaping-assistant.applandscaping-dev.tail5b443a.ts.net/upreturns 200 regardless of Host headerReview Checklist
docs/networking.md)Related Notes
None — config fix.
Related
Closes #231
Regression from: #224 / PR #230
Prior HostAuthorization fix: #103
PR #232 Review
DOMAIN REVIEW
Tech stack: Rails 8.1, k8s (k3s), Tailscale Funnel ingress.
HostAuthorization fix (production.rb lines 97-101):
config.hostsis correct. These match the URLs documented indocs/networking.mdandCLAUDE.md.host_authorizationexclude lambda for/upis the right fix. k8s liveness/readiness probes send requests with the pod IP as theHostheader, which will never match a named host. Excluding/uplets probes pass without weakening DNS rebinding protection for the rest of the app.request.path == "/up"), which is appropriately narrow. No path traversal risk./uproute is confirmed atconfig/routes.rb:4(get "up" => "rails/health#show"), so the excluded path maps to a real, read-only health endpoint.Environment consistency verified:
development.rb:76already hasconfig.hosts << "landscaping-dev.tail5b443a.ts.net"-- no action needed there.test.rb:34-35clears hosts and excludes all requests from host auth entirely -- appropriate for test environment, no conflict with this change.Documentation (networking.md):
config.hostsentries exactly.config.hostsinproduction.rband update this table") is a good operational safeguard against future regressions.BLOCKERS
None.
NITS
config.action_mailer.default_url_optionsat line 70 still useshost: "example.com". Not introduced by this PR, but worth a follow-up ticket if mailer functionality is ever enabled.SOP COMPLIANCE
231-fix-host-authorizationreferences issue #231)Closes #231present in Related sectionspec/requests/health_spec.rbcovers the/upendpoint. No new application logic was added -- this is config-only, so no new tests are required.PROCESS OBSERVATIONS
This is a clean incident response: PR #230 introduced a regression (HostAuthorization enabled with incomplete host list), the fix is minimal and correctly scoped, and the documentation update prevents recurrence by documenting the maintenance procedure. The single-commit, two-file change keeps the blast radius small. Good DORA practice -- fast recovery from a config regression.
VERDICT: APPROVED