member-device takeover: #1069's mesh-identity carry-over returns the installed member at the installer's mesh address with a FRESH SSH host key, and nothing drops the installer's stale known_hosts pin — the post-takeover seed refuses it as a changed key #1075
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#1075
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Drive
20260831T160611Zred atdeploy-takeover(sig800a2936720b), the third consecutive red on this signature.artifacts/legs.json— 26 green, one red;artifacts/verdict.jsonnamesfirstRedLeg: deploy-takeoverat commit63e16af7.The takeover worked — this is the step after it
The two prior heals on this signature both held. The gateway journal (
logs/gateway-journal.txt) has the whole story:GLlD46g…atroot@100.96.107.87went dark; the #1013 liveness watchdog reaped the kexec phase, exactly as designed.JnLTOwQBVIq09wVBI3ts9MqnwL9AHklnt+vvXlLarHs=,running version v0.71.4. The #1068 re-point resolved to its address,100.96.83.143, and (sincebae17488) landed it on the config-repo inventory. disko / install / reboot ran there.running version v0.72.3: the installed member, carrying the installer's netbird identity onto the disk exactly ascarryOverMeshIdentitypromises (internal/clan/enrollment.go:2093-2119, #1069 ruling option A). Same peer ⇒ same mesh address100.96.83.143.StepSeedClosures(internal/provision/takeover.go:110-117) red on the changed host key.The defect
carryOverMeshIdentitycopiesmeshStateDir=/var/lib/netbird-mesh(internal/clan/netbird.go:753) and only that. The mesh identity survives the re-image; the SSH host identity does not — the installed NixOS generates its own. #1069 therefore converts what used to be "new address, new key" (harmless: nothing was pinned at the new address) into "same address, changed key" (fatal: something is pinned there).What pinned it: every enrollment probe dials the re-pointed target with
StrictHostKeyChecking=accept-newand noUserKnownHostsFileoverride —sshProbeArgs(internal/clan/enrollment.go:1566-1574), used bycarryOverMeshIdentity(:2121),probeCurrentSystem(:1549) andswitchInFlight(:1594), plus the #996/#1013 reachability probes (internal/clan/adapter.go:287-296, 352-356, 607-611, 645-649).Adapter.sshKnownHostsFileis set by exactly one wiring — the app helper's own-VPS carrier (app/helper/cmd/helper/wiring_prod.go:106) — and not by the gateway control plane, so on the gateway these all learn into ambient/root/.ssh/known_hosts, the file ssh names in the error.Why nothing caught it earlier in the leg: every
clanCLI invocation in the enrollment passes--host-key-check none— the install phases (internal/clan/enrollment.go:1721) and verify'smachines update(:1350). So the takeover and the clan join go green over a box whose key has changed underneath them.Supply.Seed(internal/clan/supply.go:46-56) is the first strict-checked reconnect: barenix flake archive --to ssh-ng://<target>, no host-key discipline at all, so it inherits ssh's strict default and correctly refuses.This is precisely the fault
internal/fleetwire/carrier.go:186-200already words for the own-VPS carrier: "the install legs pass --host-key-check none so they never notice. Supply is the first pinned-posture reconnect, so without this it … refuse[s] with a correct MITM warning." Founding's self-hosted full-install path closed it at the reboot boundary withRotateHostKey(internal/founding/deploy.go:367-410, #633/#438). The member-device takeover path ininternal/provision/takeover.gohas no analogue.Why a Seed-only patch is not the fix
Setting
NIX_SSHOPTSon the archive would move the red one step, not remove it:accept-newalso HARD-refuses a changed key (internal/clan/adapter.go:80-82says so in as many words), soStepDeployServicesand every subsequentUnitActive/ health probe (adapter.go:287-296, 607-611, 645-649) would red on the same key. The stale pin has to go, once, at the reboot boundary.What plugging it needs — one ruling first
Two mechanisms are already designed into this repo and they conflict:
/root/.ssh/known_hosts's entry for the re-pointed target at the post-reboot boundary and re-learn, mirroringOwnVPSCarrier.RotateHostKey(internal/fleetwire/carrier.go:194-205) —ssh-keygen -Ris a no-op on an already-dropped entry, so it is resume-safe. Needs a new keygen seam on the clanAdapter(todaysshRunisssh-only,adapter.go:84-90), its production wiring, and a fake. Placed after verify reaches Done and beforeStepSeedClosures.internal/join/takeover.go:30-39states the intent outright: "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 atinternal/enroll/community_ca.go:147. It is threaded (join/takeover.go:80) but nothing on the gateway client side consumes it: no@cert-authorityline, noknown_hostsCA entry. If this is the intended path, option 1 silently deprecates it.The ruling needed (one line from a human): does the member-device takeover rotate the pin at the reboot boundary (#633's precedent, cheap, closes this drive), or does it finally wire the community SSH CA into the gateway's host-key trust so re-images cause no churn by construction? Either answer makes this actionable; picking one unilaterally is a design decision, not a heal.
Also worth landing with the fix: a
docs/GOTCHAS.mdentry. There are neighbouring entries for the own-VPS shape (#63, and theknown_hostsnotes around L1241, L2055-2096) but none for the member-device takeover, whose distinguishing fact is that #1069 makes the address stable across the re-image and so turns the changed key from invisible into fatal.Suspected layer:
internal/clan(enrollment reboot boundary + adapter ssh seam) andinternal/provision/takeover.go(step ordering). Advances #1069.Evidence read:
artifacts/legs.json,artifacts/verdict.json,artifacts/journey.json,artifacts/host.json,artifacts/droplet-ip.txt,logs/gateway-journal.txt,logs/founding-state.log,logs/device-*.txt,logs/clan-config-snapshot.log,artifacts/journey.device-*/error-context.md. Absent from this run: a top-levelerror-context.md(it lives under the journey dir),droplet-journal.txt, andstate/clan-config(the run carriesstate/clan-config-snapshot/— bundle +tree.txt, HEADc9b34a7b). Device-side forensics are empty: the box answers on tcp/22 (logs/device-do-forensics.txt) but every harvest gotPermission denied (publickey…)from170.64.209.3— consistent with a re-imaged box whose SSH identity and authorized_keys both turned over.drive
20260831T160611Zred atdeploy-takeover:deploy failed (rescue): provision: seed node-req-0003: clan: connectivity on node-req-0003: could not reach the node: It is also possible that a host key has just been changed. Add correct host key inevidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260831T160611Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedRuled by agent under ADR 0174 (session, as Ben's hands) — option 1: rotate the pin at the reboot boundary; option 2 filed as #1076
Ruling. Land the #633 precedent on the member-device takeover path: at the post-reboot boundary — after
verifyreaches Done, beforeStepSeedClosures— drop the ambient known-hosts entry for the re-pointed target (ssh-keygen -R <rejoined-address>semantics; resume-safe as the ticket notes) and let the nextaccept-newprobe re-learn the installed system's key. New keygen seam on the clanAdapterwith production wiring + fake, mirroringOwnVPSCarrier.RotateHostKey(internal/fleetwire/carrier.go:194-205). Add thedocs/GOTCHAS.mdentry the ticket asks for (distinguishing fact: #1069 makes the address STABLE across the re-image, turning the changed key from invisible into fatal).Why 1, not 2 now. Both are two-way. Option 1 is cheap, mirrors landed art (#633/#438), and closes the drive's third consecutive red on sig
800a2936720bthis cycle. Option 2 is the right end state but is a two-sided build (nothing installs the cert on the member's sshd either) touching the same path — so it is NOT deprecated but split to #1076, to be armed once this lands. The rotation stays as the fallback for pre-CA boxes even after #1076.Scope guard: rotation is scoped to exactly the re-pointed takeover target at exactly the reboot boundary — never a blanket known-hosts wipe; every other changed-key refusal stays a loud MITM alarm (#458 posture unchanged).
Flipping
ready-for-session→ready-for-agent.swarm-claim host=elitebook-distributed-server-03 run=15282
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1075 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
netbird upis a no-op on a device already on another mesh and records the foreign address as the mesh fact; a member Files placement writes a kanidm-only files-idp.nix onto the gateway and nothing detaches it — gatew… #2040