Self-hosted takeover bakes empty root keys — the device agent does not populate PairRequest.RootAuthorizedKeys (#535 follow-up, #414) #539

Closed
opened 2026-08-14 17:38:41 +00:00 by ben · 2 comments
Owner

Symptom / gap

#535 landed the founding-side self-hosted gateway compose: a device-driven
"machine at your place" full-install founding now assembles GatewayFacts and
composes its gateway machine dir (composeSelfHostedGateway,
internal/founding/selfhostedpath.go) at the pair/deploy join, so the gateway
boots the heartbeat ARMED (claim secret + apex ride the applied revision).

To carry the box's own root keys into the takeover's access.nix (so the wiped
host stays reachable over the SAME key after the wipe — #414), #535 added an
optional enroll.PairRequest.RootAuthorizedKeys field that the founding side
consumes when present and persists onto Standup.Takeover. But the device
agent does not yet POPULATE it:
internal/join/app.go builds the PairRequest
with Probe + Network only, and internal/hostprobe captures no
/root/.ssh/authorized_keys. So a real self-hosted full-install takeover
currently bakes EMPTY root keys (honest-empty, ADR 0100) — the own-VPS carrier
scrapes the same over SSH via the fleetwire carrier, but the self-hosted device
must read its own.

Proposed fix

  • Add an authorized-keys read to internal/hostprobe (read
    /root/.ssh/authorized_keys, honest-empty on any read error, ADR 0100).
  • Thread it through internal/join/app.go's PairRequest on a full-install
    consent (VM/LAN join leaves it nil — the guest baseline mints its own trust).
  • Seam-test: a full-install pair carries the box's root keys; a VM join carries
    none.

Blocks

Phase-3 rehearsal deploy-takeover / activation legs need a self-hosted box
that stays reachable across the wipe; without real root keys baked into
access.nix the overwritten host answers no reconnect (#414). Found while
working #535.

## Symptom / gap #535 landed the founding-side self-hosted gateway compose: a device-driven "machine at your place" full-install founding now assembles `GatewayFacts` and composes its gateway machine dir (`composeSelfHostedGateway`, `internal/founding/selfhostedpath.go`) at the pair/deploy join, so the gateway boots the heartbeat ARMED (claim secret + apex ride the applied revision). To carry the box's own root keys into the takeover's `access.nix` (so the wiped host stays reachable over the SAME key after the wipe — #414), #535 added an optional `enroll.PairRequest.RootAuthorizedKeys` field that the founding side consumes when present and persists onto `Standup.Takeover`. **But the device agent does not yet POPULATE it:** `internal/join/app.go` builds the `PairRequest` with `Probe` + `Network` only, and `internal/hostprobe` captures no `/root/.ssh/authorized_keys`. So a real self-hosted full-install takeover currently bakes EMPTY root keys (honest-empty, ADR 0100) — the own-VPS carrier scrapes the same over SSH via the fleetwire carrier, but the self-hosted device must read its own. ## Proposed fix - Add an authorized-keys read to `internal/hostprobe` (read `/root/.ssh/authorized_keys`, honest-empty on any read error, ADR 0100). - Thread it through `internal/join/app.go`'s `PairRequest` on a full-install consent (VM/LAN join leaves it nil — the guest baseline mints its own trust). - Seam-test: a full-install pair carries the box's root keys; a VM join carries none. ## Blocks Phase-3 rehearsal `deploy-takeover` / `activation` legs need a self-hosted box that stays reachable across the wipe; without real root keys baked into `access.nix` the overwritten host answers no reconnect (#414). Found while working #535.
Author
Owner

swarm-claim host=matou-dev-server-01 run=6227
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=6227 (automated multi-host claim — lowest live claim id works this ticket)
Author
Owner

close-report for #539 — status success

✅ close-report gates passed — every claim verified against main; closing.

envelope
{
  "issue": 539,
  "status": "success",
  "commits": [
    "82df109"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/hostprobe/parse_test.go",
    "internal/hostprobe/prober.go",
    "internal/hostprobe/prober_test.go",
    "internal/hostprobe/sources_linux.go",
    "internal/hostprobe/sources_other.go",
    "internal/join/app.go",
    "internal/join/app_test.go",
    "internal/join/testing/fakes.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/hostprobe/... ./internal/join/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/hostprobe/... ./internal/join/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c gofmt -l internal/hostprobe/ internal/join/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Add an authorized-keys read to internal/hostprobe (read /root/.ssh/authorized_keys, honest-empty on any read error, ADR 0100)": "internal/hostprobe/prober.go: new RootAuthorizedKeys Sources field + Prober.RootAuthorizedKeys method + pure parseAuthorizedKeys; sources_linux.go reads /root/.ssh/authorized_keys returning nil on any read error; sources_other.go returns nil. Proven by TestParse_AuthorizedKeys{,Empty} and TestRootAuthorizedKeys_{ReportsTrustedRootKeys,HonestEmptyOnUnreadable} (commit 82df109)",
    "Thread it through internal/join/app.go's PairRequest on a full-install consent (VM/LAN join leaves it nil)": "internal/join/app.go Consent: on mode==ModeFull it calls o.cfg.Probe.RootAuthorizedKeys(ctx) and sets PairRequest.RootAuthorizedKeys; the Prober interface gained RootAuthorizedKeys(ctx) []string; VM/LAN leaves rootKeys nil (commit 82df109)",
    "Seam-test: a full-install pair carries the box's root keys; a VM join carries none": "internal/join/app_test.go: TestConsent_FullInstallCarriesRootKeys (recording control plane asserts PairRequest.RootAuthorizedKeys == the box's keys) and TestConsent_VMJoinCarriesNoRootKeys (asserts none) — both PASS (commit 82df109)"
  },
  "summary": "The self-hosted device agent now reads its own /root/.ssh/authorized_keys and populates PairRequest.RootAuthorizedKeys on a full-install consent, closing the #535 gap so the wiped host stays reachable over the same key (#414).",
  "blockers": []
}
**close-report** for #539 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 539, "status": "success", "commits": [ "82df109" ], "changed_files": [ "STATUS.md", "internal/hostprobe/parse_test.go", "internal/hostprobe/prober.go", "internal/hostprobe/prober_test.go", "internal/hostprobe/sources_linux.go", "internal/hostprobe/sources_other.go", "internal/join/app.go", "internal/join/app_test.go", "internal/join/testing/fakes.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/hostprobe/... ./internal/join/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/hostprobe/... ./internal/join/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c gofmt -l internal/hostprobe/ internal/join/", "exit_code": 0 } ], "criteria": { "Add an authorized-keys read to internal/hostprobe (read /root/.ssh/authorized_keys, honest-empty on any read error, ADR 0100)": "internal/hostprobe/prober.go: new RootAuthorizedKeys Sources field + Prober.RootAuthorizedKeys method + pure parseAuthorizedKeys; sources_linux.go reads /root/.ssh/authorized_keys returning nil on any read error; sources_other.go returns nil. Proven by TestParse_AuthorizedKeys{,Empty} and TestRootAuthorizedKeys_{ReportsTrustedRootKeys,HonestEmptyOnUnreadable} (commit 82df109)", "Thread it through internal/join/app.go's PairRequest on a full-install consent (VM/LAN join leaves it nil)": "internal/join/app.go Consent: on mode==ModeFull it calls o.cfg.Probe.RootAuthorizedKeys(ctx) and sets PairRequest.RootAuthorizedKeys; the Prober interface gained RootAuthorizedKeys(ctx) []string; VM/LAN leaves rootKeys nil (commit 82df109)", "Seam-test: a full-install pair carries the box's root keys; a VM join carries none": "internal/join/app_test.go: TestConsent_FullInstallCarriesRootKeys (recording control plane asserts PairRequest.RootAuthorizedKeys == the box's keys) and TestConsent_VMJoinCarriesNoRootKeys (asserts none) — both PASS (commit 82df109)" }, "summary": "The self-hosted device agent now reads its own /root/.ssh/authorized_keys and populates PairRequest.RootAuthorizedKeys on a full-install consent, closing the #535 gap so the wiped host stays reachable over the same key (#414).", "blockers": [] } ``` </details>
ben closed this issue 2026-08-14 18:10:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#539
No description provided.