Skip to content

fix(plugins): nodes add checks for a deploy host before it contacts the host (D-1219) - #401

Merged
acamarata merged 10 commits into
mainfrom
debt-6-d1219
Oct 29, 2026
Merged

acamarata merged 10 commits into
mainfrom
debt-6-d1219

Conversation

@acamarata

Copy link
Copy Markdown
Contributor

nodes add scanned the host key, ssh-probed and installed the agent before the deploy-host check ran, so a deploy host was still contacted (Epic D9 intends no contact).

  • New hook point PointPreAdd, run in Deps.Add after the destination is parsed and before the scan. Its event carries the destination and node id only.
  • Guard.CheckPreAdd (registered at that point from cmd) matches on the destination (identity from ssh -G and DNS only). A match without --allow-deploy-host is refused (E663, matched) before any scan, probe, copy or pin. With the flag the override is confirmed and audited once, there; the later CheckAdd takes Confirmed and neither asks nor audits again.
  • Matches that need the host key or machine id are still caught at the add point as before.
  • Tests: lifecycle (no scan, run, copy or pin after a refused pre-add), deployguard table (refuse, confirm once, not confirmed, no tty, unlisted), cmd hook table. Removing the hook call or the refusal fails all three.

Behaviour change to note: a destination that matches the inventory is now refused outright instead of registered as CI-ineligible; the flag path is unchanged for the operator except that the confirmation comes before contact.

Closes debt row D-1219.

@acamarata
acamarata force-pushed the debt-6-d1219 branch 2 times, most recently from af9046f to fda442b Compare October 20, 2026 14:07
acamarata and others added 10 commits October 29, 2026 12:55
…he host (D-1219)

Add a pre-add hook point that runs on the destination alone, after
ParseHostSpec and before the host-key scan. The deploy-host check
registers there (identity from ssh -G and DNS only): a match without
--allow-deploy-host is refused before any scan, probe or install, and an
override is confirmed and audited once, there. Matches that need the
host key or machine id are still caught at the add point.
…ource (D-1219)

The confirmation taken before contact covers only the match it was
given for; a different match found after contact is confirmed again.
The installer name is validated before the pre-add hook, so no override
is confirmed for an add that cannot proceed.
@acamarata

Copy link
Copy Markdown
Contributor Author

Rebased onto origin/main and resolved merge conflicts in deployguard override (ConfirmKey semantics), chokepoint/build_v15/node_prepare/single_exec tests, workflow trust YAML, and diagnostic lint refactor. All touched packages pass: protect, provision, deployguard, lifecycle, gates, agent. Pre-existing flaky failures in cmd (TestStreamSurvivesAClosedPipe timeout) and dispatch (TestInvariant_I14 SQLITE_BUSY) are unrelated to this rebase.

@acamarata
acamarata merged commit 23686e5 into main Oct 29, 2026
28 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant