reachability: founding's "outside-in" probe dials from the operator's own computer — on the self-hosted path that is the same network, so the verdict is the router's hairpin behaviour #1587

Closed
opened 2026-09-18 15:56:43 +00:00 by ben · 4 comments
Owner

What is wrong

The founding.Reachability seam is documented as an outside-in probe — "the real probe is a Matou-side outside-in check" (internal/founding/standup.go:110). The production implementation is reachability.New(), a plain local net.Dialer, wired into the app's helper process (app/helper/cmd/helper/wiring_prod.go:440). So both the Connect section's "Visitors can reach it" check (DDR 0240) and the S10 reachability gate (DDR 0188) dial from the operator's own computer.

For a rented or own-VPS gateway that is genuinely outside. For a machine at your place it is not: the operator's laptop is normally on the same home network as the machine, so the dial to the line's public address leaves and re-enters the same router. The verdict then reports the router's hairpin-NAT behaviour — many routers don't loop back at all (false fail), some loop back without consulting the port-forward table (false pass) — not whether a visitor on the internet can get in.

The codebase already says so. broker/internal/broker/frontdoor.go:14: "A gateway dialling its own public address is not outside-in — hairpin NAT makes the answer unreliable, and a probe that can lie is a fabricated fact." #813 built the broker's front-door probe for exactly this reason — for the standing fleet. Founding never got the same treatment.

The constraint

The broker probe (POST /v1/subdomains/probe) is deliberately not a general dialer: it is claim-secret gated and dials only the address the broker's own record carries for a claimed host. At founding's Connect section nothing is claimed yet — the Address step is check-only and Build it claims (#1404). So the existing route cannot serve the selection-time check as it stands.

Why human

One-way-door ruling — security posture. Any fix makes a Matou-run service dial an address at the request of a caller who has no claim yet. How that is bounded is a posture decision on the broker, a deployed public service.

Proposed default ruling

The broker gains a bounded selection-time probe that dials only the source address of the request itself — never a caller-supplied one — on the fixed web group (80/443), rate-limited per source. The machine makes the call (dial-in: the device agent during pairing; dial-out: the app asks the box to make it over the SSH connection it already holds), so the broker observes the machine's own line. This is not an open dialer (a caller can only ever have itself probed), needs no claim, and answers the public-address discovery question from the sibling ticket with a better source than OpenDNS reflection. The S10 gate, which runs after the claim exists, moves onto the existing #813 route. Own-domain communities with no broker relationship keep the local dial, and the surface names that vantage honestly (as the front-door card already does).

Acceptance criteria (once ruled)

  1. On the self-hosted path, "Visitors can reach it" and the S10 gate report a verdict obtained from outside the machine's network, and the result names its vantage.
  2. No broker route dials a caller-supplied address.
  3. With no broker relationship the check says where it measured from; it never presents a same-network dial as outside-in.
  4. The Reachability interface comment matches what production does.
  5. A drive leg proves it on a genuinely NATed box (none exists today — #1450's targets all carry public NIC addresses).

The sibling ticket (the visitors check probes the machine's private NIC address) fixes WHICH address is probed; this fixes WHERE FROM. That one is unblocked by this and should land first.

## What is wrong The `founding.Reachability` seam is documented as an **outside-in** probe — "the real probe is a Matou-side outside-in check" (`internal/founding/standup.go:110`). The production implementation is `reachability.New()`, a plain local `net.Dialer`, wired into the **app's helper process** (`app/helper/cmd/helper/wiring_prod.go:440`). So both the Connect section's "Visitors can reach it" check (DDR 0240) and the S10 reachability gate (DDR 0188) dial **from the operator's own computer**. For a rented or own-VPS gateway that is genuinely outside. For **a machine at your place** it is not: the operator's laptop is normally on the same home network as the machine, so the dial to the line's public address leaves and re-enters the same router. The verdict then reports the router's hairpin-NAT behaviour — many routers don't loop back at all (false fail), some loop back without consulting the port-forward table (false pass) — not whether a visitor on the internet can get in. The codebase already says so. `broker/internal/broker/frontdoor.go:14`: *"A gateway dialling its own public address is not outside-in — hairpin NAT makes the answer unreliable, and a probe that can lie is a fabricated fact."* #813 built the broker's front-door probe for exactly this reason — for the standing fleet. Founding never got the same treatment. ## The constraint The broker probe (`POST /v1/subdomains/probe`) is deliberately not a general dialer: it is claim-secret gated and dials **only the address the broker's own record carries** for a claimed host. At founding's Connect section nothing is claimed yet — the Address step is check-only and Build it claims (#1404). So the existing route cannot serve the selection-time check as it stands. ## Why human **One-way-door ruling — security posture.** Any fix makes a Matou-run service dial an address at the request of a caller who has no claim yet. How that is bounded is a posture decision on the broker, a deployed public service. ## Proposed default ruling The broker gains a bounded selection-time probe that dials **only the source address of the request itself** — never a caller-supplied one — on the fixed web group (80/443), rate-limited per source. The **machine** makes the call (dial-in: the device agent during pairing; dial-out: the app asks the box to make it over the SSH connection it already holds), so the broker observes the machine's own line. This is not an open dialer (a caller can only ever have itself probed), needs no claim, and answers the public-address discovery question from the sibling ticket with a better source than OpenDNS reflection. The S10 gate, which runs after the claim exists, moves onto the existing #813 route. Own-domain communities with no broker relationship keep the local dial, and the surface names that vantage honestly (as the front-door card already does). ## Acceptance criteria (once ruled) 1. On the self-hosted path, "Visitors can reach it" and the S10 gate report a verdict obtained from outside the machine's network, and the result names its vantage. 2. No broker route dials a caller-supplied address. 3. With no broker relationship the check says where it measured from; it never presents a same-network dial as outside-in. 4. The `Reachability` interface comment matches what production does. 5. A drive leg proves it on a genuinely NATed box (none exists today — #1450's targets all carry public NIC addresses). ## Related The sibling ticket (the visitors check probes the machine's private NIC address) fixes WHICH address is probed; this fixes WHERE FROM. That one is unblocked by this and should land first.
Author
Owner

The sibling ticket referred to above is #1585. Also related: #1586 (helpers should not carry the visitors check at all, which narrows this to the gateway).

The sibling ticket referred to above is #1585. Also related: #1586 (helpers should not carry the visitors check at all, which narrows this to the gateway).
Author
Owner

Ruled: the proposed default is ACCEPTED (Ben, 2026-09-18)

Ben accepts the proposed default ruling above as written. The security-posture question this ticket was ready-for-human for is closed:

  1. The broker gains a bounded selection-time probe that dials only the source address of the request itself — never a caller-supplied address. A caller can only ever have itself probed, so this is not an open dialer and needs no claim.
  2. Fixed web group only (80/443), rate-limited per source.
  3. The machine makes the call, so the broker observes the machine's own line: on dial-in the device agent during pairing; on dial-out the app has the box make it over the SSH connection it already holds.
  4. The observed source address is also the machine's public-facing address — a better source than the OpenDNS reflection for #1585's fact, where a broker relationship exists.
  5. The S10 gate, which runs after the claim exists, moves onto the existing #813 POST /v1/subdomains/probe route.
  6. Own-domain communities with no broker relationship keep the local dial, and the surface names that vantage honestly — it never presents a same-network dial as outside-in.

For the implementer: record this ruling as an ADR in the same commit as the broker route (check origin/main before minting the number), and update the affected docs/architecture/ diagram if one draws the founding↔broker edge (ADR 0042). broker/** is a deployed-service tree, so expect the deploy-pending rail after merge (#1187).

AC5 (a drive leg on a genuinely NATed box) needs hardware no current drive target has — it does not gate closing the code work here; it is carried by the note already on #1450.

Relabelled ready-for-human → ready-for-agent. Blocked by #1585 (which address is probed lands first), wired as a native dependency.

## Ruled: the proposed default is ACCEPTED (Ben, 2026-09-18) Ben accepts the proposed default ruling above as written. The security-posture question this ticket was `ready-for-human` for is closed: 1. The broker gains a bounded **selection-time probe** that dials **only the source address of the request itself** — never a caller-supplied address. A caller can only ever have itself probed, so this is not an open dialer and needs no claim. 2. Fixed **web group only (80/443)**, **rate-limited per source**. 3. The **machine** makes the call, so the broker observes the machine's own line: on dial-in the device agent during pairing; on dial-out the app has the box make it over the SSH connection it already holds. 4. The observed source address is also the machine's public-facing address — a better source than the OpenDNS reflection for #1585's fact, where a broker relationship exists. 5. The **S10 gate**, which runs after the claim exists, moves onto the existing #813 `POST /v1/subdomains/probe` route. 6. **Own-domain communities with no broker relationship** keep the local dial, and the surface names that vantage honestly — it never presents a same-network dial as outside-in. **For the implementer:** record this ruling as an ADR in the same commit as the broker route (check `origin/main` before minting the number), and update the affected `docs/architecture/` diagram if one draws the founding↔broker edge (ADR 0042). `broker/**` is a deployed-service tree, so expect the `deploy-pending` rail after merge (#1187). **AC5** (a drive leg on a genuinely NATed box) needs hardware no current drive target has — it does not gate closing the code work here; it is carried by the note already on #1450. Relabelled `ready-for-human` → `ready-for-agent`. Blocked by #1585 (which address is probed lands first), wired as a native dependency.

Landed the security-posture CORE Ben ruled; handing off AC1

Commit fb2d2b3c (on origin/main) implements the self-contained core of the 2026-09-18 ruling, seam-proven:

  • POST /v1/reachability/self (broker/internal/broker/selfprobe.go, FrontDoor.ProbeSource): dials ONLY the request's own source line — the connection's RemoteAddr, never a caller-supplied address/field/header (an X-Forwarded-For is spoofable; trusting it would make an open dialer — AC2) — on ONLY the fixed web group (80/443). Needs no claim (a caller can only ever have itself probed), and is rate-limited per source (sourceLimiter, resets after a window). Rides the same wired FrontDoor vantage as #813 (WithFrontDoor now registers both routes).
  • ADR 0253 records the ruling (docs/adr/0253-*.md).
  • AC4 — the founding.Reachability interface comment now matches production (a local dial from the app's own line: genuinely outside-in for a rented/own-VPS box, a same-network hairpin for a machine-at-your-place).
  • AC3 (data tier) — ReachabilityResult/ReachStatus/DeviceCheck carry Vantage; the local prober stamps founding.VantageThisComputer on every verdict, so the seam never presents a same-network dial as outside-in. Proven by a founding connect-seam test (vantage flows onto the visitors check, pass + fail).
  • GOTCHAS #250 — the proxy-hides-RemoteAddr deploy hazard for the new route.

Proof: go build/vet + broker + founding + reachability suites green; gofmt clean; pre-push gate "0 issues". broker/** → deploy-pending (#1187).

Why human

AC1 — the MACHINE calling the route so ITS own line is measured outside-in (the device agent during dial-in pairing; the app over SSH on dial-out), and the verdict reaching the "Visitors can reach it" check and the S10 gate — rests on a design-contract decision the code tier surfaced:

Ben's ruling point 5 says "The S10 gate, which runs after the claim exists, moves onto the existing #813 route." But #813 (POST /v1/subdomains/probe) dials the address the broker's own record carries for the claimed host — and at S10 time the subdomain is claimed but not yet pointed (RunReachability points the name only on a PASS, via wireName). So #813 would return ErrNoRecordedAddress at S10. Resolving this needs a call that touches what founding promises:

  • (a) point the name BEFORE the S10 gate, then probe via #813 — but this contradicts ADR 0049 ("reachability proven BEFORE the name is wired"), the same founding-contract meaning ADR 0188 recorded as a human-only call; or
  • (b) S10 consumes the pairing-time observation the machine's self-probe already gathered (via the new /v1/reachability/self), instead of #813 — outside-in via the same broker vantage, with no ADR 0049 reordering. This departs from the ruling's literal "#813".

This is the founding-contract meaning, not plumbing — not agent-decidable under ADR 0174 (ADR 0188 is the precedent: option (b)-style reorderings there were explicitly a human call).

Also needs-design: the vantage LINE ("checked from …") has no wireframe — the Connect/S10 screens have no design state for naming the vantage, so the AC1/AC3 UI presentation is design-gated.

Remaining engineering once the above is ruled (no further human call needed)

  • Device agent (dial-in): call /v1/reachability/self during pairing and carry the observation in enroll.NetworkFacts (+ its OpenAPI mirror), so AwaitDialIn/CheckDevice read the broker vantage for a same-network machine instead of local-dialing.
  • App over SSH (dial-out): have the box make the call over the connection the carrier holds.
  • Surface the vantage in app/src/lib/founding.ts + FoundingConnectDevice.vue / FoundingReachability.vue (once the wireframe exists).
  • AC5 (a genuinely-NATed drive box) is carried by the note on #1450 and does not gate the code work.
## Landed the security-posture CORE Ben ruled; handing off AC1 Commit `fb2d2b3c` (on `origin/main`) implements the self-contained core of the 2026-09-18 ruling, seam-proven: - **`POST /v1/reachability/self`** (`broker/internal/broker/selfprobe.go`, `FrontDoor.ProbeSource`): dials **ONLY the request's own source line** — the connection's `RemoteAddr`, never a caller-supplied address/field/header (an `X-Forwarded-For` is spoofable; trusting it would make an open dialer — **AC2**) — on **ONLY the fixed web group (80/443)**. Needs **no claim** (a caller can only ever have itself probed), and is **rate-limited per source** (`sourceLimiter`, resets after a window). Rides the same wired `FrontDoor` vantage as #813 (`WithFrontDoor` now registers both routes). - **ADR 0253** records the ruling (`docs/adr/0253-*.md`). - **AC4** — the `founding.Reachability` interface comment now matches production (a local dial from the app's own line: genuinely outside-in for a rented/own-VPS box, a same-network hairpin for a machine-at-your-place). - **AC3 (data tier)** — `ReachabilityResult`/`ReachStatus`/`DeviceCheck` carry `Vantage`; the local prober stamps `founding.VantageThisComputer` on every verdict, so the seam never presents a same-network dial as outside-in. Proven by a founding connect-seam test (vantage flows onto the visitors check, pass + fail). - **GOTCHAS #250** — the proxy-hides-`RemoteAddr` deploy hazard for the new route. Proof: `go build`/`vet` + broker + founding + reachability suites green; gofmt clean; pre-push gate "0 issues". `broker/**` → `deploy-pending` (#1187). ## Why human **AC1** — the MACHINE calling the route so ITS own line is measured outside-in (the device agent during dial-in pairing; the app over SSH on dial-out), and the verdict reaching the "Visitors can reach it" check **and the S10 gate** — rests on a **design-contract decision the code tier surfaced**: > Ben's ruling point 5 says *"The S10 gate, which runs after the claim exists, moves onto the existing #813 route."* But `#813` (`POST /v1/subdomains/probe`) dials the address **the broker's own record carries** for the claimed host — and at S10 time the subdomain is **claimed but not yet pointed** (`RunReachability` points the name only on a PASS, via `wireName`). So #813 would return `ErrNoRecordedAddress` at S10. Resolving this needs a call that touches what founding **promises**: > > - **(a)** point the name BEFORE the S10 gate, then probe via #813 — but this contradicts **ADR 0049** ("reachability proven BEFORE the name is wired"), the same founding-contract meaning ADR 0188 recorded as a human-only call; **or** > - **(b)** S10 consumes the **pairing-time observation** the machine's self-probe already gathered (via the new `/v1/reachability/self`), instead of #813 — outside-in via the same broker vantage, with no ADR 0049 reordering. This departs from the ruling's literal "#813". This is the founding-contract meaning, not plumbing — not agent-decidable under ADR 0174 (ADR 0188 is the precedent: option (b)-style reorderings there were explicitly a human call). **Also needs-design:** the vantage LINE ("checked from …") has no wireframe — the Connect/S10 screens have no design state for naming the vantage, so the AC1/AC3 **UI** presentation is design-gated. ## Remaining engineering once the above is ruled (no further human call needed) - Device agent (dial-in): call `/v1/reachability/self` during pairing and carry the observation in `enroll.NetworkFacts` (+ its OpenAPI mirror), so `AwaitDialIn`/`CheckDevice` read the broker vantage for a same-network machine instead of local-dialing. - App over SSH (dial-out): have the box make the call over the connection the carrier holds. - Surface the `vantage` in `app/src/lib/founding.ts` + `FoundingConnectDevice.vue` / `FoundingReachability.vue` (once the wireframe exists). - **AC5** (a genuinely-NATed drive box) is carried by the note on #1450 and does not gate the code work.
Author
Owner

Closed 2026-10-21 (Ben's ruling): folded into the drive checklist #2055 — the live proof this ticket still owed is now a checklist item there, to be carried by the next drives on the latest versions. A proof that fails on the drive becomes a NEW ticket; this one is not reopened.

Closed 2026-10-21 (Ben's ruling): folded into the drive checklist #2055 — the live proof this ticket still owed is now a checklist item there, to be carried by the next drives on the latest versions. A proof that fails on the drive becomes a NEW ticket; this one is not reopened.
ben 2026-10-21 21:51:26 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1587
No description provided.