ssh host trust: consume the community-signed SSH host cert on the gateway (and install it on the member), so re-images cause no known-hosts churn by construction — spike #12 §1, #1075 option 2 #1076

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

What

#1075's option 2, split out so option 1 could close the drive: the member-device takeover (and the gateway generally) should consume the community-signed SSH host certificate so a re-image causes no known-hosts churn by construction.

The intent is already in the tree, one side only:

  • internal/join/takeover.go:30-39: "The community-signed SSH host cert is what carries the gateway's trust across the re-image without known_hosts churn (spike #12 §1)" — TakeoverContract.SSHHostCert, minted at internal/enroll/community_ca.go:147, threaded at join/takeover.go:80.
  • Nothing on the gateway client side consumes it: no @cert-authority known_hosts line, no CA entry — and (verify when picking this up) the installed member may also need the signed cert + HostCertificate actually installed on its sshd.

Rule

Wire both halves: the installed member's sshd presents the community-signed host cert (minted per node, delivered on the disk the takeover already writes — never through the config repo), and the gateway's ssh trust carries one @cert-authority line for the community CA (in the app-scoped known-hosts pin, ADR 0152/#458 posture), so every re-image under the same CA verifies with zero churn. #1075's reboot-boundary ssh-keygen -R rotation then becomes a no-op fallback rather than the mechanism, and stays for pre-CA boxes.

Acceptance

  • A member-device takeover on a drive completes StepSeedClosures/StepDeployServices with the rotation seam LOGGING a no-op (cert verified, nothing to drop).
  • Contract tests: gateway probe argv carries the CA-bearing known-hosts file; member render/installer carries the host cert material; no secret lands in the replicated config repo (ADR 0126).
  • ADR: record the trust model (which ADR carries it — 0152 amendment or new) and close the spike #12 §1 loop.

Arm after #1075's rotation lands and the drive is past this rung; touching the same takeover path concurrently invites merge races.

## What #1075's option 2, split out so option 1 could close the drive: the member-device takeover (and the gateway generally) should **consume the community-signed SSH host certificate** so a re-image causes no known-hosts churn by construction. The intent is already in the tree, one side only: - `internal/join/takeover.go:30-39`: "The community-signed SSH host cert is what carries the gateway's trust across the re-image without known_hosts churn (spike #12 §1)" — `TakeoverContract.SSHHostCert`, minted at `internal/enroll/community_ca.go:147`, threaded at `join/takeover.go:80`. - Nothing on the **gateway client side** consumes it: no `@cert-authority` known_hosts line, no CA entry — and (verify when picking this up) the installed member may also need the signed cert + `HostCertificate` actually installed on its sshd. ## Rule Wire both halves: the installed member's sshd presents the community-signed host cert (minted per node, delivered on the disk the takeover already writes — never through the config repo), and the gateway's ssh trust carries one `@cert-authority` line for the community CA (in the app-scoped known-hosts pin, ADR 0152/#458 posture), so every re-image under the same CA verifies with zero churn. #1075's reboot-boundary `ssh-keygen -R` rotation then becomes a no-op fallback rather than the mechanism, and stays for pre-CA boxes. ## Acceptance - A member-device takeover on a drive completes `StepSeedClosures`/`StepDeployServices` with the rotation seam LOGGING a no-op (cert verified, nothing to drop). - Contract tests: gateway probe argv carries the CA-bearing known-hosts file; member render/installer carries the host cert material; no secret lands in the replicated config repo (ADR 0126). - ADR: record the trust model (which ADR carries it — 0152 amendment or new) and close the spike #12 §1 loop. Arm after #1075's rotation lands and the drive is past this rung; touching the same takeover path concurrently invites merge races.

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Category: enhancement (new capability — the consuming/client side of the SSH host-CA trust; the minting half already exists in the tree). State: ready-for-agent, gated behind a native blocked-by #1075 dependency.

The ruling and why it is a two-way door

This touches SSH host trust, which sits near the one-way-door "security-posture widening" line, so it gets an explicit ruling rather than a silent label.

It is not a widening. Adding one @cert-authority line for the community's own CA replaces per-host TOFU known_hosts pins with CA-scoped verification of the community's own nodes — the same CA that already mints these certs (internal/enroll/community_ca.go:147, signHostCredential). Trust scope is exactly the set of nodes the community already vouches for; no new public surface or port, no auth loosened for outsiders. It preserves the verification property the acceptance demands ("every re-image under the same CA verifies with zero churn") and keeps secrets out of the replicated config repo (ADR 0126). The current ssh-keygen -R rotation is the weaker TOFU-on-reconnect mechanism this replaces; it stays as a no-op fallback for pre-CA boxes.

  • Revertible by a commit: drop the @cert-authority line / HostCertificate render and the rotation fallback resumes — no data destroyed, no credential rotated.
  • Provable by existing test/drive/probe: the acceptance is all contract tests (gateway probe argv carries the CA-bearing known-hosts file; member render/installer carries the host-cert material; no secret in the config repo) plus a member-device takeover drive completing with the rotation seam logging a no-op.
  • Not on the one-way-door list (no personal credentials, no security-posture widening, no member-person-facing trust accept — this is machine-to-machine host-key verification, no data destruction, no non-routine spend).

Sibling signal: #1075 (option 1) is already ready-for-agent; this is option 2 of the same #1075 work, same class, so it is likewise swarm-suitable.

Codebase check

  • Not redundant. The intent is in the tree one side only: TakeoverContract.SSHHostCert is minted (community_ca.go:147) and threaded (join/takeover.go:39,80). grep -rn 'cert-authority|HostCertificate' internal/ returns nothing — neither the gateway client @cert-authority trust nor the member sshd HostCertificate install exists yet. The consuming side the issue asks for is genuinely unbuilt.
  • No missing design contract. Backend infra; no flow/wireframe/seam referenced — the needs-design gate does not fire. The ADR the acceptance calls for (0152 amendment vs. new) is a design-tier decision an agent session may take and record under ADR 0174 rule 1.

Why the #1075 dependency, not bare ready-for-agent

The body says "Arm after #1075's rotation lands ... touching the same takeover path concurrently invites merge races." A bare ready-for-agent would let the swarm race #1075 on internal/join/takeover.go. The native blocked-by #1075 link keeps #1076 out of list-ready-tasks.sh until #1075 closes; it then surfaces automatically (it also carries priority). Remove the link to un-gate early — itself a two-way door.

Agent brief

  • Do: wire both halves. (a) Member sshd presents the community-signed host cert — HostCertificate in the rendered sshd config, cert material delivered on the disk the takeover already writes, never through the config repo (ADR 0126). (b) Gateway ssh trust carries one @cert-authority <community-CA-pubkey> line in the app-scoped known-hosts pin (ADR 0152 / #458 posture). Make #1075's reboot-boundary ssh-keygen -R a logged no-op fallback that stays for pre-CA boxes.
  • Verify when starting (per the body): whether the installed member also needs the signed cert + HostCertificate actually installed on its sshd — confirm against internal/join/takeover.go and the member render path.
  • Acceptance (from the issue): takeover drive completes StepSeedClosures/StepDeployServices with the rotation seam logging a no-op; contract tests for gateway probe argv (CA-bearing known-hosts), member render/installer (host-cert material), and no-secret-in-config-repo; an ADR recording the trust model that closes the spike #12 §1 loop.
> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** **Category:** `enhancement` (new capability — the consuming/client side of the SSH host-CA trust; the minting half already exists in the tree). **State:** `ready-for-agent`, gated behind a native **blocked-by #1075** dependency. ## The ruling and why it is a two-way door This touches SSH host trust, which sits *near* the one-way-door "security-posture widening" line, so it gets an explicit ruling rather than a silent label. It is **not** a widening. Adding one `@cert-authority` line for the **community's own CA** replaces per-host TOFU known_hosts pins with CA-scoped verification of the community's own nodes — the same CA that already mints these certs (`internal/enroll/community_ca.go:147`, `signHostCredential`). Trust scope is exactly the set of nodes the community already vouches for; no new public surface or port, no auth loosened for outsiders. It *preserves* the verification property the acceptance demands ("every re-image under the same CA verifies with zero churn") and keeps secrets out of the replicated config repo (ADR 0126). The current `ssh-keygen -R` rotation is the weaker TOFU-on-reconnect mechanism this replaces; it stays as a no-op fallback for pre-CA boxes. - **Revertible** by a commit: drop the `@cert-authority` line / `HostCertificate` render and the rotation fallback resumes — no data destroyed, no credential rotated. - **Provable** by existing test/drive/probe: the acceptance is all contract tests (gateway probe argv carries the CA-bearing known-hosts file; member render/installer carries the host-cert material; no secret in the config repo) plus a member-device takeover drive completing with the rotation seam **logging a no-op**. - **Not on the one-way-door list** (no personal credentials, no security-posture widening, no member-*person*-facing trust accept — this is machine-to-machine host-key verification, no data destruction, no non-routine spend). Sibling signal: **#1075 (option 1) is already `ready-for-agent`**; this is option 2 of the same #1075 work, same class, so it is likewise swarm-suitable. ## Codebase check - **Not redundant.** The intent is in the tree one side only: `TakeoverContract.SSHHostCert` is minted (`community_ca.go:147`) and threaded (`join/takeover.go:39,80`). `grep -rn 'cert-authority|HostCertificate' internal/` returns **nothing** — neither the gateway client `@cert-authority` trust nor the member sshd `HostCertificate` install exists yet. The consuming side the issue asks for is genuinely unbuilt. - **No missing design contract.** Backend infra; no flow/wireframe/seam referenced — the `needs-design` gate does not fire. The ADR the acceptance calls for (0152 amendment vs. new) is a design-tier decision an agent session may take and record under ADR 0174 rule 1. ## Why the #1075 dependency, not bare ready-for-agent The body says "Arm after #1075's rotation lands ... touching the same takeover path concurrently invites merge races." A bare `ready-for-agent` would let the swarm race #1075 on `internal/join/takeover.go`. The native **blocked-by #1075** link keeps #1076 out of `list-ready-tasks.sh` until #1075 closes; it then surfaces automatically (it also carries `priority`). Remove the link to un-gate early — itself a two-way door. ## Agent brief - **Do:** wire both halves. (a) Member sshd presents the community-signed host cert — `HostCertificate` in the rendered sshd config, cert material delivered on the disk the takeover already writes, **never** through the config repo (ADR 0126). (b) Gateway ssh trust carries one `@cert-authority <community-CA-pubkey>` line in the app-scoped known-hosts pin (ADR 0152 / #458 posture). Make #1075's reboot-boundary `ssh-keygen -R` a logged no-op fallback that stays for pre-CA boxes. - **Verify when starting** (per the body): whether the installed member also needs the signed cert + `HostCertificate` actually installed on its sshd — confirm against `internal/join/takeover.go` and the member render path. - **Acceptance** (from the issue): takeover drive completes `StepSeedClosures`/`StepDeployServices` with the rotation seam logging a no-op; contract tests for gateway probe argv (CA-bearing known-hosts), member render/installer (host-cert material), and no-secret-in-config-repo; an ADR recording the trust model that closes the spike #12 §1 loop.

swarm-claim host=elitebook-distributed-server-03 run=15282
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=15282 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1076 — status success

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

envelope
{
  "issue": 1076,
  "status": "success",
  "commits": [
    "dd14f7546409b64226cafc9b7e3c6307ae1f58a5"
  ],
  "changed_files": [
    "STATUS.md",
    "go.mod",
    "docs/adr/0218-design-community-ssh-host-ca-trust.md",
    "internal/clan/adapter.go",
    "internal/clan/clan.go",
    "internal/clan/enrollment.go",
    "internal/clan/hostca.go",
    "internal/clan/hostca_test.go",
    "internal/clan/host_cert_test.go",
    "internal/clan/seedcommunity_eval_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/clan/... ./internal/provision/... ./internal/enroll/... ./internal/join/... ./internal/fleetstate/... ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/clan/... ./internal/provision/...",
      "exit_code": 0
    },
    {
      "command": "gofmt -l (changed .go files)",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/clan/...",
      "exit_code": 0
    },
    {
      "command": "git pre-push gate (nix develop .#go-ci: build+vet+test+lint over the whole module)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A member-device takeover completes StepSeedClosures/StepDeployServices with the rotation seam LOGGING a no-op (cert verified, nothing to drop)": "internal/clan/adapter.go RotateHostKey logs a no-op and drops nothing when the community host CA is trusted (WithCommunityHostCA); provision's StepSeedClosures still calls it unchanged from #1075. Proven at the seam by TestRotateHostKey_CommunityCAMakesItANoOp (hostca_test.go). Honest caveat (ADR 0218 + STATUS): the production composition does NOT wire WithCommunityHostCA yet, so a live drive still rotates — the prod turn-on is deferred pending real OpenSSH-cert minting; #1075's rotation continues to carry every re-image, nothing regresses.",
    "Contract test: gateway probe argv carries the CA-bearing known-hosts file": "TestEnsureCommunityHostCATrust_InstallsTheCertAuthorityLine (hostca_test.go): EnsureCommunityHostCATrust writes the @cert-authority line into the app-scoped known-hosts pin and the UnitActive probe argv carries UserKnownHostsFile=<that file>.",
    "Contract test: member render/installer carries the host cert material": "TestEnroll_MemberHostCertDeliveredToDiskNotConfigRepo + TestRenderAccess_EmitsHostCertificateWhenPresent (host_cert_test.go): renderAccess names HostCertificate (MemberHostCertPath), and enrollment.installHostCert delivers the base64 material onto /mnt<path> over ssh between disko and install.",
    "Contract test: no secret lands in the replicated config repo (ADR 0126)": "assertNotInConfigRepo in host_cert_test.go walks the whole config repo and asserts neither the raw cert material nor its base64 form appears in any file.",
    "ADR: record the trust model and close the spike #12 §1 loop": "docs/adr/0218-design-community-ssh-host-ca-trust.md — one community root anchors both faces (@cert-authority gateway trust + member HostCertificate), amends ADR 0152/0111, records the deferred production turn-on, and closes the spike #12 §1 loop."
  },
  "summary": "Wired the consuming side of the community SSH host-CA trust at the clan seam — gateway @cert-authority trust, member HostCertificate delivered on-disk (never the config repo), RotateHostKey no-op fallback — with contract tests and DDR 0218 closing the spike #12 §1 loop.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1076 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1076, "status": "success", "commits": [ "dd14f7546409b64226cafc9b7e3c6307ae1f58a5" ], "changed_files": [ "STATUS.md", "go.mod", "docs/adr/0218-design-community-ssh-host-ca-trust.md", "internal/clan/adapter.go", "internal/clan/clan.go", "internal/clan/enrollment.go", "internal/clan/hostca.go", "internal/clan/hostca_test.go", "internal/clan/host_cert_test.go", "internal/clan/seedcommunity_eval_test.go" ], "tests": [ { "command": "go test ./internal/clan/... ./internal/provision/... ./internal/enroll/... ./internal/join/... ./internal/fleetstate/... ./control-plane/...", "exit_code": 0 }, { "command": "go vet ./internal/clan/... ./internal/provision/...", "exit_code": 0 }, { "command": "gofmt -l (changed .go files)", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/clan/...", "exit_code": 0 }, { "command": "git pre-push gate (nix develop .#go-ci: build+vet+test+lint over the whole module)", "exit_code": 0 } ], "criteria": { "A member-device takeover completes StepSeedClosures/StepDeployServices with the rotation seam LOGGING a no-op (cert verified, nothing to drop)": "internal/clan/adapter.go RotateHostKey logs a no-op and drops nothing when the community host CA is trusted (WithCommunityHostCA); provision's StepSeedClosures still calls it unchanged from #1075. Proven at the seam by TestRotateHostKey_CommunityCAMakesItANoOp (hostca_test.go). Honest caveat (ADR 0218 + STATUS): the production composition does NOT wire WithCommunityHostCA yet, so a live drive still rotates — the prod turn-on is deferred pending real OpenSSH-cert minting; #1075's rotation continues to carry every re-image, nothing regresses.", "Contract test: gateway probe argv carries the CA-bearing known-hosts file": "TestEnsureCommunityHostCATrust_InstallsTheCertAuthorityLine (hostca_test.go): EnsureCommunityHostCATrust writes the @cert-authority line into the app-scoped known-hosts pin and the UnitActive probe argv carries UserKnownHostsFile=<that file>.", "Contract test: member render/installer carries the host cert material": "TestEnroll_MemberHostCertDeliveredToDiskNotConfigRepo + TestRenderAccess_EmitsHostCertificateWhenPresent (host_cert_test.go): renderAccess names HostCertificate (MemberHostCertPath), and enrollment.installHostCert delivers the base64 material onto /mnt<path> over ssh between disko and install.", "Contract test: no secret lands in the replicated config repo (ADR 0126)": "assertNotInConfigRepo in host_cert_test.go walks the whole config repo and asserts neither the raw cert material nor its base64 form appears in any file.", "ADR: record the trust model and close the spike #12 §1 loop": "docs/adr/0218-design-community-ssh-host-ca-trust.md — one community root anchors both faces (@cert-authority gateway trust + member HostCertificate), amends ADR 0152/0111, records the deferred production turn-on, and closes the spike #12 §1 loop." }, "summary": "Wired the consuming side of the community SSH host-CA trust at the clan seam — gateway @cert-authority trust, member HostCertificate delivered on-disk (never the config repo), RotateHostKey no-op fallback — with contract tests and DDR 0218 closing the spike #12 §1 loop.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
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#1076
No description provided.