device-add: nothing teaches a joining device to trust the gateway's deploy key — every takeover deploy is refused publickey #1007

Closed
opened 2026-08-29 23:52:54 +00:00 by matou-build-agent · 3 comments

Failure

Drive 20260829T232735Z (run dir test-results/drive-device/20260829T232735Z) red at leg deploy-takeover, signature 800a2936720b, 26 legs green before it:

deploy failed (rescue): clan: unreachable on node-req-0003: the takeover's deploy target
root@100.107.208.101 is not reachable from this host — no SSH session could be established
before the install began: exit status 255: root@100.107.208.101: Permission denied (publickey).

(artifacts/legs.json, last entry; artifacts/verdict.json firstRedLeg: deploy-takeover.)

This is not a routing or liveness fault. The device answers: logs/device-units.txt shows sshd on 0.0.0.0:22 and the mesh address 100.107.208.101 bound by netbird; logs/device-journal.txt:1450 records the gateway's own attempt reaching preauth —
sshd[10335]: Connection closed by authenticating user root 100.107.93.51 port 58778 [preauth] (100.107.93.51 is the gateway's wt0 address, logs/gateway-units.txt). It is purely an authentication failure: the key the gateway offers is not in the device's /root/.ssh/authorized_keys.

Evidence — the key is never conveyed, and never installed

  1. The gateway offers its loopback self-deploy key. The control plane's clan adapter is built with no WithSSHIdentityFile (the only production caller is the operator app's helper, app/helper/cmd/helper/wiring_prod.go:103), so enrollment.identity() returns "" (internal/clan/enrollment.go:1397-1405) and Adapter.reachable runs ssh with no -i (internal/clan/adapter.go:286-302). Root's default identity on the gateway is the key idss-self-trust mints for the loopback self-deploy: internal/clan/vmguest.go:668-681 (ssh-keygen ... -C idss-self-deploy, then appended to the gateway's own authorized_keys). Nothing ever ships its public half anywhere else.

  2. The device installs no SSH trust at landing. The agent's whole write surface at join is four files: the community CA at /usr/local/share/ca-certificates/idss-community.crt (agent/internal/trust/trust.go:56 — x509 trust, not SSH), and contract.json / node / staged under /var/lib/idss/takeover (agent/internal/stage/stage.go:54-63). agent/internal/meshup/meshup.go touches no SSH at all. The ✓ community trust installed line (internal/join/cli.go:268) is the CA install — it does not authorize anyone for root.

  3. The grant carries no deploy key to install. IdentityGrant.ClanTrust is {CAPubKey, Principals} (internal/enroll/enroll.go:315-329), filled with the raw community root ed25519 pubkey and the node name (internal/enroll/community_ca.go:146-151). There is no field for the gateway's SSH deploy key, and the device's sshd is never configured with TrustedUserCAKeys, so the CA-cert route is not wired either. Netbird's own SSH is off (logs/gateway-journal.txt: SSH server is locally allowed but disabled by management server).

  4. idss-enroll-trust does not cover member devices. It is the gateway shape's fw_cfg unit and explicitly never runs on a real droplet (internal/clan/vmguest.go:466-492).

Second face of the same gap — the post-takeover device would be bricked

internal/provision/takeover.go:150-159 builds the device's EnrollRequest with Device/Node/Role/Install/Network and Target only — no AuthorizedKeys. That field feeds NodeConfig.RootAuthorizedKeys (internal/clan/enrollment.go:375), which writeNodeConfig renders into the member's access.nix (internal/clan/enrollment.go:521). With it empty, renderAccess emits users.users.root.openssh.authorizedKeys.keys = [ ]; (internal/clan/enrollment.go:611-629). Its own doc comment names the consequence — "the takeover 'succeeds' and the box is then unreachable forever (#414)" — and asserts the case is unreachable because "the connect leg refuses a box with no root key before this is ever reached". That guard is the founding connect leg; the device-add path has no equivalent, so it reaches renderAccess with an empty list.

So fixing only the pre-takeover reachability would be worse than the current red: the wipe would run and the paid droplet would come back permanently unreachable. Both faces must land together.

Suspected layer

A missing mechanism, not a broken line: member-device SSH trust between the gateway control plane and a landed device. It spans internal/enroll (the grant/landing payload), agent/internal/trust (the device-side install), and internal/provision/takeover.go (the post-takeover bake). No existing code path can be pointed at as "wrong" — the path was never built.

What plugging it needs

Follow the precedent already in the tree for the rented gateway (#709/#414): a bare deploy public key seeded into root's authorized_keys, both live and baked.

  1. Convey the key. Carry the gateway control plane's deploy public key (/root/.ssh/id_ed25519.pub, minted by idss-self-trust, internal/clan/vmguest.go:668-676) on the approval payload the device receives — e.g. a DeployAuthorizedKeys []string on enroll.ClanTrust (internal/enroll/enroll.go:315), populated where CommunityCA.Grant builds it (internal/enroll/community_ca.go:146-151) or at Ledger.Approve alongside the mesh admission, from a new read-the-plane's-own-pubkey port. Note the key is minted by a systemd unit at boot, so the control plane must read it at approval time, not bake it at render time.
  2. Install it live at landing. In agent/internal/trust/trust.go, add an idempotent append to /root/.ssh/authorized_keys (mkdir 0700 / touch 0600 / grep -qxF guard — mirror gatewaySelfTrustUnit's own script, internal/clan/vmguest.go:668-681) before Up. This is what makes the reachability preflight pass. Empty key ⇒ refuse loudly rather than install hollow trust, matching InstallCerts' existing posture (ADR 0100).
  3. Bake it across the wipe. Set req.AuthorizedKeys in internal/provision/takeover.go:150-159 from the same key, so renderAccess emits a non-empty list and the re-imaged device answers the enroll-activate reconnect. Consider an explicit refusal in renderAccess/writeNodeConfig when a member full-install would bake an empty key list — the guard renderAccess' comment assumes exists.

Design note for the implementer: an alternative is the SSH-CA route — ClanTrust already carries {CAPubKey, Principals}, which reads like it was meant for TrustedUserCAKeys plus a community-signed user cert for the control plane. That is cleaner (no per-device key distribution, revocable) but needs a user-cert minting path that does not exist yet, and CAPubKey today is a raw 32-byte ed25519 key written to a .crt (agent/internal/trust/trust.go:56) — not an OpenSSH CA key. Recommend the bare-key route for this fix and record the CA route as the follow-on, unless a maintainer rules otherwise.

Testing: the seam tests here are unit-level (internal/clan/enrollment_test.go covers renderAccess/access.nix; agent/internal/trust/trust_test.go covers the trust adapter; internal/provision/takeover_test.go covers the EnrollRequest shape). The real proof is a re-drive of drive-device past deploy-takeover — a paid event, so land all three parts before re-arming.

Not this

Healer commit ccee5984 self-fixed this same signature by exporting HOME=/root in the control-plane unit (internal/clan/vmguest.go, drive 20260829T182130Z). That fix is real and still in place — it cleared nixos-anywhere's HOME: unbound variable and let the run get as far as the reachability preflight, which is where this defect lives. The signature repeating does not mean that fix regressed.

drive 20260829T232735Z red at deploy-takeover: deploy failed (rescue): clan: unreachable on node-req-0003: the takeover's deploy target root@100.107.208.101 is not reachable from this host — no SSH session could be established before the install
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260829T232735Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## Failure Drive `20260829T232735Z` (run dir `test-results/drive-device/20260829T232735Z`) red at leg `deploy-takeover`, signature `800a2936720b`, 26 legs green before it: ``` deploy failed (rescue): clan: unreachable on node-req-0003: the takeover's deploy target root@100.107.208.101 is not reachable from this host — no SSH session could be established before the install began: exit status 255: root@100.107.208.101: Permission denied (publickey). ``` (`artifacts/legs.json`, last entry; `artifacts/verdict.json` `firstRedLeg: deploy-takeover`.) This is **not** a routing or liveness fault. The device answers: `logs/device-units.txt` shows sshd on `0.0.0.0:22` and the mesh address `100.107.208.101` bound by netbird; `logs/device-journal.txt:1450` records the gateway's own attempt reaching preauth — `sshd[10335]: Connection closed by authenticating user root 100.107.93.51 port 58778 [preauth]` (`100.107.93.51` is the gateway's wt0 address, `logs/gateway-units.txt`). It is purely an **authentication** failure: the key the gateway offers is not in the device's `/root/.ssh/authorized_keys`. ## Evidence — the key is never conveyed, and never installed 1. **The gateway offers its loopback self-deploy key.** The control plane's clan adapter is built with no `WithSSHIdentityFile` (the only production caller is the operator app's helper, `app/helper/cmd/helper/wiring_prod.go:103`), so `enrollment.identity()` returns `""` (`internal/clan/enrollment.go:1397-1405`) and `Adapter.reachable` runs `ssh` with no `-i` (`internal/clan/adapter.go:286-302`). Root's default identity on the gateway is the key `idss-self-trust` mints for the **loopback** self-deploy: `internal/clan/vmguest.go:668-681` (`ssh-keygen ... -C idss-self-deploy`, then appended to the gateway's *own* authorized_keys). Nothing ever ships its public half anywhere else. 2. **The device installs no SSH trust at landing.** The agent's whole write surface at join is four files: the community CA at `/usr/local/share/ca-certificates/idss-community.crt` (`agent/internal/trust/trust.go:56` — x509 trust, not SSH), and `contract.json` / `node` / `staged` under `/var/lib/idss/takeover` (`agent/internal/stage/stage.go:54-63`). `agent/internal/meshup/meshup.go` touches no SSH at all. The `✓ community trust installed` line (`internal/join/cli.go:268`) is the CA install — it does not authorize anyone for root. 3. **The grant carries no deploy key to install.** `IdentityGrant.ClanTrust` is `{CAPubKey, Principals}` (`internal/enroll/enroll.go:315-329`), filled with the raw community **root ed25519 pubkey** and the node name (`internal/enroll/community_ca.go:146-151`). There is no field for the gateway's SSH deploy key, and the device's sshd is never configured with `TrustedUserCAKeys`, so the CA-cert route is not wired either. Netbird's own SSH is off (`logs/gateway-journal.txt`: `SSH server is locally allowed but disabled by management server`). 4. **`idss-enroll-trust` does not cover member devices.** It is the gateway shape's fw_cfg unit and explicitly never runs on a real droplet (`internal/clan/vmguest.go:466-492`). ### Second face of the same gap — the post-takeover device would be bricked `internal/provision/takeover.go:150-159` builds the device's `EnrollRequest` with `Device/Node/Role/Install/Network` and `Target` only — **no `AuthorizedKeys`**. That field feeds `NodeConfig.RootAuthorizedKeys` (`internal/clan/enrollment.go:375`), which `writeNodeConfig` renders into the member's `access.nix` (`internal/clan/enrollment.go:521`). With it empty, `renderAccess` emits `users.users.root.openssh.authorizedKeys.keys = [ ];` (`internal/clan/enrollment.go:611-629`). Its own doc comment names the consequence — "the takeover 'succeeds' and the box is then unreachable forever (#414)" — and asserts the case is unreachable because "the connect leg refuses a box with no root key before this is ever reached". That guard is the **founding** connect leg; the device-add path has no equivalent, so it reaches renderAccess with an empty list. So fixing only the pre-takeover reachability would be worse than the current red: the wipe would run and the paid droplet would come back permanently unreachable. Both faces must land together. ## Suspected layer A missing mechanism, not a broken line: **member-device SSH trust between the gateway control plane and a landed device**. It spans `internal/enroll` (the grant/landing payload), `agent/internal/trust` (the device-side install), and `internal/provision/takeover.go` (the post-takeover bake). No existing code path can be pointed at as "wrong" — the path was never built. ## What plugging it needs Follow the precedent already in the tree for the rented gateway (#709/#414): a bare deploy public key seeded into root's authorized_keys, both live and baked. 1. **Convey the key.** Carry the gateway control plane's deploy public key (`/root/.ssh/id_ed25519.pub`, minted by `idss-self-trust`, `internal/clan/vmguest.go:668-676`) on the approval payload the device receives — e.g. a `DeployAuthorizedKeys []string` on `enroll.ClanTrust` (`internal/enroll/enroll.go:315`), populated where `CommunityCA.Grant` builds it (`internal/enroll/community_ca.go:146-151`) or at `Ledger.Approve` alongside the mesh admission, from a new read-the-plane's-own-pubkey port. Note the key is minted by a systemd unit at boot, so the control plane must read it at approval time, not bake it at render time. 2. **Install it live at landing.** In `agent/internal/trust/trust.go`, add an idempotent append to `/root/.ssh/authorized_keys` (mkdir 0700 / touch 0600 / `grep -qxF` guard — mirror `gatewaySelfTrustUnit`'s own script, `internal/clan/vmguest.go:668-681`) before `Up`. This is what makes the reachability preflight pass. Empty key ⇒ refuse loudly rather than install hollow trust, matching `InstallCerts`' existing posture (ADR 0100). 3. **Bake it across the wipe.** Set `req.AuthorizedKeys` in `internal/provision/takeover.go:150-159` from the same key, so `renderAccess` emits a non-empty list and the re-imaged device answers the enroll-activate reconnect. Consider an explicit refusal in `renderAccess`/`writeNodeConfig` when a **member** full-install would bake an empty key list — the guard `renderAccess`' comment assumes exists. **Design note for the implementer:** an alternative is the SSH-CA route — `ClanTrust` already carries `{CAPubKey, Principals}`, which reads like it was meant for `TrustedUserCAKeys` plus a community-signed user cert for the control plane. That is cleaner (no per-device key distribution, revocable) but needs a user-cert minting path that does not exist yet, and `CAPubKey` today is a raw 32-byte ed25519 key written to a `.crt` (`agent/internal/trust/trust.go:56`) — not an OpenSSH CA key. Recommend the bare-key route for this fix and record the CA route as the follow-on, unless a maintainer rules otherwise. **Testing:** the seam tests here are unit-level (`internal/clan/enrollment_test.go` covers `renderAccess`/`access.nix`; `agent/internal/trust/trust_test.go` covers the trust adapter; `internal/provision/takeover_test.go` covers the EnrollRequest shape). The real proof is a re-drive of `drive-device` past `deploy-takeover` — a paid event, so land all three parts before re-arming. ## Not this Healer commit `ccee5984` self-fixed this same signature by exporting `HOME=/root` in the control-plane unit (`internal/clan/vmguest.go`, drive `20260829T182130Z`). That fix is real and still in place — it cleared nixos-anywhere's `HOME: unbound variable` and let the run get as far as the reachability preflight, which is where this defect lives. The signature repeating does not mean that fix regressed. drive `20260829T232735Z` red at `deploy-takeover`: `deploy failed (rescue): clan: unreachable on node-req-0003: the takeover's deploy target root@100.107.208.101 is not reachable from this host — no SSH session could be established before the install` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260829T232735Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 800a2936720b -->
Author
Member

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

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

close-report for #1007 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • commit 8165443e2d is not reachable from origin/main (not landed)
  • changed_files: 'STATUS.md' is not in the diff of the claimed commits
  • changed_files: 'agent/internal/trust/trust.go' is not in the diff of the claimed commits
  • changed_files: 'agent/internal/trust/trust_test.go' is not in the diff of the claimed commits
  • changed_files: 'control-plane/cmd/control-plane/compose.go' is not in the diff of the claimed commits
  • changed_files: 'control-plane/cmd/control-plane/compose_enroll_test.go' is not in the diff of the claimed commits
  • changed_files: 'control-plane/cmd/control-plane/whole_composition.go' is not in the diff of the claimed commits
  • changed_files: 'internal/enroll/enroll.go' is not in the diff of the claimed commits
  • changed_files: 'internal/enroll/enroll_test.go' is not in the diff of the claimed commits
  • changed_files: 'internal/enroll/errors.go' is not in the diff of the claimed commits
  • changed_files: 'internal/enroll/ledger.go' is not in the diff of the claimed commits
  • changed_files: 'internal/provision/provision.go' is not in the diff of the claimed commits
  • changed_files: 'internal/provision/takeover.go' is not in the diff of the claimed commits
  • changed_files: 'internal/provision/takeover_test.go' is not in the diff of the claimed commits
envelope
{
  "issue": 1007,
  "status": "success",
  "commits": [
    "8165443e2d65a1be438370508ad96b7183638cf7"
  ],
  "changed_files": [
    "STATUS.md",
    "agent/internal/trust/trust.go",
    "agent/internal/trust/trust_test.go",
    "control-plane/cmd/control-plane/compose.go",
    "control-plane/cmd/control-plane/compose_enroll_test.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "internal/enroll/enroll.go",
    "internal/enroll/enroll_test.go",
    "internal/enroll/errors.go",
    "internal/enroll/ledger.go",
    "internal/provision/provision.go",
    "internal/provision/takeover.go",
    "internal/provision/takeover_test.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/enroll/... ./agent/internal/trust/... ./internal/provision/... ./control-plane/cmd/control-plane/...",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/join/... ./internal/clan/... ./internal/controlapi/... ./internal/founding/...",
      "exit_code": 0
    },
    {
      "command": "pre-push gate: nix develop .#go-ci — gofmt/build/vet/test/golangci-lint (main module + broker)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Convey the key: the gateway control plane's deploy public key is carried on the approval payload the device receives": "internal/enroll/enroll.go adds ClanTrust.DeployAuthorizedKeys; internal/enroll/ledger.go Approve populates it for member/worker grants from the new Config.DeployKeySource port, failing loud (ErrNoDeployKey, internal/enroll/errors.go) before minting on an unreadable/empty key. Proven by TestApprove_ConveysGatewayDeployKey / _NoDeployKeyFailsLoud / _GatewayNeedsNoDeployKey (internal/enroll/enroll_test.go).",
    "Install it live at landing: an idempotent append to /root/.ssh/authorized_keys before Up, empty key refused loud": "agent/internal/trust/trust.go InstallCerts calls authorizeDeployKeys (mkdir 0700 / touch 0600 / grep -qxF guard, mirroring gatewaySelfTrustUnit) before Up; a member grant (redeemable mesh admission) with no key is refused. Proven by TestTrust_AuthorizesGatewayDeployKey / _RefusesMemberGrantWithNoDeployKey / _FoundingGatewayNeedsNoDeployKey (agent/internal/trust/trust_test.go).",
    "Bake it across the wipe: req.AuthorizedKeys is set in the full-install takeover so renderAccess emits a non-empty list": "internal/provision/takeover.go sets req.AuthorizedKeys from the new provision.WithDeployKeys reader (internal/provision/provision.go); an empty reader refuses the takeover before enrolling. Proven by TestDeployTakeover_BakesGatewayDeployKey / _RefusesEmptyDeployKey (internal/provision/takeover_test.go).",
    "Production wiring reads the key at approval/deploy time, not render time": "control-plane/cmd/control-plane/whole_composition.go adds selfDeployAuthorizedKeys reading /root/.ssh/id_ed25519.pub live, wired into enrollCfg.DeployKeySource and provision.WithDeployKeys; injectable via composeDeps.deployKeySource (compose.go). Proven green by TestComposeEnroll_WholeApprovesWithTheCommunityCA."
  },
  "summary": "device-add now conveys, live-installs, and bakes the gateway control plane's own SSH deploy key so a joining member device authorises the gateway's inbound deploy door, closing both faces of the deploy-takeover publickey refusal (#1007/#414).",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1007 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit 8165443e2d65a1be438370508ad96b7183638cf7 is not reachable from origin/main (not landed) - changed_files: 'STATUS.md' is not in the diff of the claimed commits - changed_files: 'agent/internal/trust/trust.go' is not in the diff of the claimed commits - changed_files: 'agent/internal/trust/trust_test.go' is not in the diff of the claimed commits - changed_files: 'control-plane/cmd/control-plane/compose.go' is not in the diff of the claimed commits - changed_files: 'control-plane/cmd/control-plane/compose_enroll_test.go' is not in the diff of the claimed commits - changed_files: 'control-plane/cmd/control-plane/whole_composition.go' is not in the diff of the claimed commits - changed_files: 'internal/enroll/enroll.go' is not in the diff of the claimed commits - changed_files: 'internal/enroll/enroll_test.go' is not in the diff of the claimed commits - changed_files: 'internal/enroll/errors.go' is not in the diff of the claimed commits - changed_files: 'internal/enroll/ledger.go' is not in the diff of the claimed commits - changed_files: 'internal/provision/provision.go' is not in the diff of the claimed commits - changed_files: 'internal/provision/takeover.go' is not in the diff of the claimed commits - changed_files: 'internal/provision/takeover_test.go' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 1007, "status": "success", "commits": [ "8165443e2d65a1be438370508ad96b7183638cf7" ], "changed_files": [ "STATUS.md", "agent/internal/trust/trust.go", "agent/internal/trust/trust_test.go", "control-plane/cmd/control-plane/compose.go", "control-plane/cmd/control-plane/compose_enroll_test.go", "control-plane/cmd/control-plane/whole_composition.go", "internal/enroll/enroll.go", "internal/enroll/enroll_test.go", "internal/enroll/errors.go", "internal/enroll/ledger.go", "internal/provision/provision.go", "internal/provision/takeover.go", "internal/provision/takeover_test.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go test ./internal/enroll/... ./agent/internal/trust/... ./internal/provision/... ./control-plane/cmd/control-plane/...", "exit_code": 0 }, { "command": "go test ./internal/join/... ./internal/clan/... ./internal/controlapi/... ./internal/founding/...", "exit_code": 0 }, { "command": "pre-push gate: nix develop .#go-ci — gofmt/build/vet/test/golangci-lint (main module + broker)", "exit_code": 0 } ], "criteria": { "Convey the key: the gateway control plane's deploy public key is carried on the approval payload the device receives": "internal/enroll/enroll.go adds ClanTrust.DeployAuthorizedKeys; internal/enroll/ledger.go Approve populates it for member/worker grants from the new Config.DeployKeySource port, failing loud (ErrNoDeployKey, internal/enroll/errors.go) before minting on an unreadable/empty key. Proven by TestApprove_ConveysGatewayDeployKey / _NoDeployKeyFailsLoud / _GatewayNeedsNoDeployKey (internal/enroll/enroll_test.go).", "Install it live at landing: an idempotent append to /root/.ssh/authorized_keys before Up, empty key refused loud": "agent/internal/trust/trust.go InstallCerts calls authorizeDeployKeys (mkdir 0700 / touch 0600 / grep -qxF guard, mirroring gatewaySelfTrustUnit) before Up; a member grant (redeemable mesh admission) with no key is refused. Proven by TestTrust_AuthorizesGatewayDeployKey / _RefusesMemberGrantWithNoDeployKey / _FoundingGatewayNeedsNoDeployKey (agent/internal/trust/trust_test.go).", "Bake it across the wipe: req.AuthorizedKeys is set in the full-install takeover so renderAccess emits a non-empty list": "internal/provision/takeover.go sets req.AuthorizedKeys from the new provision.WithDeployKeys reader (internal/provision/provision.go); an empty reader refuses the takeover before enrolling. Proven by TestDeployTakeover_BakesGatewayDeployKey / _RefusesEmptyDeployKey (internal/provision/takeover_test.go).", "Production wiring reads the key at approval/deploy time, not render time": "control-plane/cmd/control-plane/whole_composition.go adds selfDeployAuthorizedKeys reading /root/.ssh/id_ed25519.pub live, wired into enrollCfg.DeployKeySource and provision.WithDeployKeys; injectable via composeDeps.deployKeySource (compose.go). Proven green by TestComposeEnroll_WholeApprovesWithTheCommunityCA." }, "summary": "device-add now conveys, live-installs, and bakes the gateway control plane's own SSH deploy key so a joining member device authorises the gateway's inbound deploy door, closing both faces of the deploy-takeover publickey refusal (#1007/#414).", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Author
Member

close-report for #1007 — status success

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

envelope
{
  "issue": 1007,
  "status": "success",
  "commits": [
    "8165443e2d65a1be438370508ad96b7183638cf7"
  ],
  "changed_files": [
    "STATUS.md",
    "agent/internal/trust/trust.go",
    "agent/internal/trust/trust_test.go",
    "control-plane/cmd/control-plane/compose.go",
    "control-plane/cmd/control-plane/compose_enroll_test.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "internal/enroll/enroll.go",
    "internal/enroll/enroll_test.go",
    "internal/enroll/errors.go",
    "internal/enroll/ledger.go",
    "internal/provision/provision.go",
    "internal/provision/takeover.go",
    "internal/provision/takeover_test.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/enroll/... ./agent/internal/trust/... ./internal/provision/... ./control-plane/cmd/control-plane/...",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/join/... ./internal/clan/... ./internal/controlapi/... ./internal/founding/...",
      "exit_code": 0
    },
    {
      "command": "pre-push gate: nix develop .#go-ci — gofmt/build/vet/test/golangci-lint (main module + broker)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Convey the key: the gateway control plane's deploy public key is carried on the approval payload the device receives": "internal/enroll/enroll.go adds ClanTrust.DeployAuthorizedKeys; internal/enroll/ledger.go Approve populates it for member/worker grants from the new Config.DeployKeySource port, failing loud (ErrNoDeployKey, internal/enroll/errors.go) before minting on an unreadable/empty key. Proven by TestApprove_ConveysGatewayDeployKey / _NoDeployKeyFailsLoud / _GatewayNeedsNoDeployKey (internal/enroll/enroll_test.go).",
    "Install it live at landing: an idempotent append to /root/.ssh/authorized_keys before Up, empty key refused loud": "agent/internal/trust/trust.go InstallCerts calls authorizeDeployKeys (mkdir 0700 / touch 0600 / grep -qxF guard, mirroring gatewaySelfTrustUnit) before Up; a member grant (redeemable mesh admission) with no key is refused. Proven by TestTrust_AuthorizesGatewayDeployKey / _RefusesMemberGrantWithNoDeployKey / _FoundingGatewayNeedsNoDeployKey (agent/internal/trust/trust_test.go).",
    "Bake it across the wipe: req.AuthorizedKeys is set in the full-install takeover so renderAccess emits a non-empty list": "internal/provision/takeover.go sets req.AuthorizedKeys from the new provision.WithDeployKeys reader (internal/provision/provision.go); an empty reader refuses the takeover before enrolling. Proven by TestDeployTakeover_BakesGatewayDeployKey / _RefusesEmptyDeployKey (internal/provision/takeover_test.go).",
    "Production wiring reads the key at approval/deploy time, not render time": "control-plane/cmd/control-plane/whole_composition.go adds selfDeployAuthorizedKeys reading /root/.ssh/id_ed25519.pub live, wired into enrollCfg.DeployKeySource and provision.WithDeployKeys; injectable via composeDeps.deployKeySource (compose.go). Proven green by TestComposeEnroll_WholeApprovesWithTheCommunityCA."
  },
  "summary": "device-add now conveys, live-installs, and bakes the gateway control plane's own SSH deploy key so a joining member device authorises the gateway's inbound deploy door, closing both faces of the deploy-takeover publickey refusal (#1007/#414).",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1007 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1007, "status": "success", "commits": [ "8165443e2d65a1be438370508ad96b7183638cf7" ], "changed_files": [ "STATUS.md", "agent/internal/trust/trust.go", "agent/internal/trust/trust_test.go", "control-plane/cmd/control-plane/compose.go", "control-plane/cmd/control-plane/compose_enroll_test.go", "control-plane/cmd/control-plane/whole_composition.go", "internal/enroll/enroll.go", "internal/enroll/enroll_test.go", "internal/enroll/errors.go", "internal/enroll/ledger.go", "internal/provision/provision.go", "internal/provision/takeover.go", "internal/provision/takeover_test.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go test ./internal/enroll/... ./agent/internal/trust/... ./internal/provision/... ./control-plane/cmd/control-plane/...", "exit_code": 0 }, { "command": "go test ./internal/join/... ./internal/clan/... ./internal/controlapi/... ./internal/founding/...", "exit_code": 0 }, { "command": "pre-push gate: nix develop .#go-ci — gofmt/build/vet/test/golangci-lint (main module + broker)", "exit_code": 0 } ], "criteria": { "Convey the key: the gateway control plane's deploy public key is carried on the approval payload the device receives": "internal/enroll/enroll.go adds ClanTrust.DeployAuthorizedKeys; internal/enroll/ledger.go Approve populates it for member/worker grants from the new Config.DeployKeySource port, failing loud (ErrNoDeployKey, internal/enroll/errors.go) before minting on an unreadable/empty key. Proven by TestApprove_ConveysGatewayDeployKey / _NoDeployKeyFailsLoud / _GatewayNeedsNoDeployKey (internal/enroll/enroll_test.go).", "Install it live at landing: an idempotent append to /root/.ssh/authorized_keys before Up, empty key refused loud": "agent/internal/trust/trust.go InstallCerts calls authorizeDeployKeys (mkdir 0700 / touch 0600 / grep -qxF guard, mirroring gatewaySelfTrustUnit) before Up; a member grant (redeemable mesh admission) with no key is refused. Proven by TestTrust_AuthorizesGatewayDeployKey / _RefusesMemberGrantWithNoDeployKey / _FoundingGatewayNeedsNoDeployKey (agent/internal/trust/trust_test.go).", "Bake it across the wipe: req.AuthorizedKeys is set in the full-install takeover so renderAccess emits a non-empty list": "internal/provision/takeover.go sets req.AuthorizedKeys from the new provision.WithDeployKeys reader (internal/provision/provision.go); an empty reader refuses the takeover before enrolling. Proven by TestDeployTakeover_BakesGatewayDeployKey / _RefusesEmptyDeployKey (internal/provision/takeover_test.go).", "Production wiring reads the key at approval/deploy time, not render time": "control-plane/cmd/control-plane/whole_composition.go adds selfDeployAuthorizedKeys reading /root/.ssh/id_ed25519.pub live, wired into enrollCfg.DeployKeySource and provision.WithDeployKeys; injectable via composeDeps.deployKeySource (compose.go). Proven green by TestComposeEnroll_WholeApprovesWithTheCommunityCA." }, "summary": "device-add now conveys, live-installs, and bakes the gateway control plane's own SSH deploy key so a joining member device authorises the gateway's inbound deploy door, closing both faces of the deploy-takeover publickey refusal (#1007/#414).", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
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.

Reference
Matou/idss#1007
No description provided.