branded-chrome's occ ssh refuses the takeover's new host key — sshDroplet needs per-run known-hosts isolation #569

Closed
opened 2026-08-15 05:28:07 +00:00 by ben · 3 comments
Owner

Drive 20260815T051508Z — oidc-admin GREEN (#565 proven: the operator signs into Nextcloud through the public door) — red at branded-chrome, the last never-before-executed leg, one step from the first full phase-2 green:

ssh root@170.64.186.60 "nextcloud-occ config:list theming --output=json" exited 255:
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

Cause

sshDroplet (app/tests/e2e/fixtures/droplet.ts) runs with StrictHostKeyChecking=accept-new against the DEFAULT ~/.ssh/known_hosts. Its docstring wants a changed key on a reused IP to refuse loudly — right instinct, wrong store for a drive harness:

  • the nixos-anywhere takeover REFORMATS the box mid-drive, so the droplet's host key changes ubuntu→NixOS within a single run by construction;
  • something in the drive stores the PRE-takeover key in the default known_hosts (the create-time ssh-keygen -R scrub in scripts/lib/rehearsal-droplet.sh:268 happens before that, so it cannot help);
  • DO recycles IPs across drives, so the default file also accumulates cross-drive stale keys.

The harness's own precedent is already per-run isolation: rehearsal-droplet.sh:138 uses UserKnownHostsFile=/dev/null, and the evidence harvester (fixtures/evidence.ts:123) does too. sshDroplet is the odd one out.

Fix

Give sshDroplet (and sshDropletInteractive — same file, same exposure) a per-run known-hosts file instead of the operator's default — e.g. -o UserKnownHostsFile=<runDir or tmp>/known_hosts threaded from the spec, or accepted as an optional param defaulting to an env-provided path (OC_E2E_KNOWN_HOSTS), keeping accept-new + BatchMode. That preserves the docstring's refuse-on-change contract WITHIN a leg (a mid-command MITM still refuses) while immunising against the takeover boundary and cross-drive IP recycling. /dev/null is acceptable too if threading a path is awkward — the other harness sshes already accept that trade.

  • Both journey specs benefit: journey.droplet.spec.ts:538 (this red) and journey.selfhosted.spec.ts (four call sites — plausibly related to #563's ssh-255 family).
  • Unit-test the option assembly (droplet.test.ts exists).
  • No product code in scope — this is drive-harness only.

advances #492

Drive `20260815T051508Z` — **oidc-admin GREEN (#565 proven: the operator signs into Nextcloud through the public door)** — red at `branded-chrome`, the last never-before-executed leg, one step from the first full phase-2 green: ``` ssh root@170.64.186.60 "nextcloud-occ config:list theming --output=json" exited 255: WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! ``` ## Cause `sshDroplet` (app/tests/e2e/fixtures/droplet.ts) runs with `StrictHostKeyChecking=accept-new` against the DEFAULT `~/.ssh/known_hosts`. Its docstring wants a changed key on a reused IP to refuse loudly — right instinct, wrong store for a drive harness: - the nixos-anywhere takeover REFORMATS the box mid-drive, so the droplet's host key changes ubuntu→NixOS within a single run by construction; - something in the drive stores the PRE-takeover key in the default known_hosts (the create-time `ssh-keygen -R` scrub in scripts/lib/rehearsal-droplet.sh:268 happens before that, so it cannot help); - DO recycles IPs across drives, so the default file also accumulates cross-drive stale keys. The harness's own precedent is already per-run isolation: `rehearsal-droplet.sh:138` uses `UserKnownHostsFile=/dev/null`, and the evidence harvester (fixtures/evidence.ts:123) does too. `sshDroplet` is the odd one out. ## Fix Give `sshDroplet` (and `sshDropletInteractive` — same file, same exposure) a per-run known-hosts file instead of the operator's default — e.g. `-o UserKnownHostsFile=<runDir or tmp>/known_hosts` threaded from the spec, or accepted as an optional param defaulting to an env-provided path (`OC_E2E_KNOWN_HOSTS`), keeping `accept-new` + `BatchMode`. That preserves the docstring's refuse-on-change contract WITHIN a leg (a mid-command MITM still refuses) while immunising against the takeover boundary and cross-drive IP recycling. `/dev/null` is acceptable too if threading a path is awkward — the other harness sshes already accept that trade. - Both journey specs benefit: `journey.droplet.spec.ts:538` (this red) and `journey.selfhosted.spec.ts` (four call sites — plausibly related to #563's ssh-255 family). - Unit-test the option assembly (droplet.test.ts exists). - No product code in scope — this is drive-harness only. advances #492
Author
Owner

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

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

close-report for #569 — status success

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

  • commit 1f0bcb6 is not reachable from origin/main (not landed on main)
  • changed_files: 'app/tests/e2e/fixtures/droplet.ts' is not in the diff of the claimed commits
  • changed_files: 'app/tests/e2e/fixtures/droplet.test.ts' is not in the diff of the claimed commits
  • changed_files: 'STATUS.md' is not in the diff of the claimed commits
envelope
{
  "issue": 569,
  "status": "success",
  "commits": [
    "1f0bcb6"
  ],
  "changed_files": [
    "app/tests/e2e/fixtures/droplet.ts",
    "app/tests/e2e/fixtures/droplet.test.ts",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "npx vitest run tests/e2e/fixtures/droplet.test.ts",
      "exit_code": 0
    },
    {
      "command": "npx vue-tsc --noEmit -p tsconfig.json",
      "exit_code": 0
    },
    {
      "command": "npx eslint tests/e2e/fixtures/droplet.ts tests/e2e/fixtures/droplet.test.ts",
      "exit_code": 0
    }
  ],
  "criteria": {
    "sshDroplet no longer pins the operator default known_hosts (fix)": "droplet.ts knownHostsFile() adds -o UserKnownHostsFile on both dials, OC_E2E_KNOWN_HOSTS or /dev/null",
    "sshDropletInteractive gets the same isolation (same exposure)": "droplet.ts -tt dial threads UserKnownHostsFile; test 'threads the OC_E2E_KNOWN_HOSTS store into the -tt dial'",
    "accept-new + BatchMode preserved (refuse-on-change within a leg)": "droplet.ts keeps StrictHostKeyChecking=accept-new + BatchMode=yes unchanged; test asserts accept-new present",
    "option assembly unit-tested (droplet.test.ts)": "3 new tests: env threaded, /dev/null fallback, interactive dial; vitest 8 passed",
    "no product code in scope (drive-harness only)": "changed_files are e2e fixtures + STATUS.md only"
  },
  "summary": "sshDroplet/sshDropletInteractive now pin a per-run known-hosts store so the nixos-anywhere takeover's mid-drive host-key change no longer reds the branded-chrome occ dial.",
  "blockers": []
}
**close-report** for #569 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit 1f0bcb6 is not reachable from origin/main (not landed on main) - changed_files: 'app/tests/e2e/fixtures/droplet.ts' is not in the diff of the claimed commits - changed_files: 'app/tests/e2e/fixtures/droplet.test.ts' is not in the diff of the claimed commits - changed_files: 'STATUS.md' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 569, "status": "success", "commits": [ "1f0bcb6" ], "changed_files": [ "app/tests/e2e/fixtures/droplet.ts", "app/tests/e2e/fixtures/droplet.test.ts", "STATUS.md" ], "tests": [ { "command": "npx vitest run tests/e2e/fixtures/droplet.test.ts", "exit_code": 0 }, { "command": "npx vue-tsc --noEmit -p tsconfig.json", "exit_code": 0 }, { "command": "npx eslint tests/e2e/fixtures/droplet.ts tests/e2e/fixtures/droplet.test.ts", "exit_code": 0 } ], "criteria": { "sshDroplet no longer pins the operator default known_hosts (fix)": "droplet.ts knownHostsFile() adds -o UserKnownHostsFile on both dials, OC_E2E_KNOWN_HOSTS or /dev/null", "sshDropletInteractive gets the same isolation (same exposure)": "droplet.ts -tt dial threads UserKnownHostsFile; test 'threads the OC_E2E_KNOWN_HOSTS store into the -tt dial'", "accept-new + BatchMode preserved (refuse-on-change within a leg)": "droplet.ts keeps StrictHostKeyChecking=accept-new + BatchMode=yes unchanged; test asserts accept-new present", "option assembly unit-tested (droplet.test.ts)": "3 new tests: env threaded, /dev/null fallback, interactive dial; vitest 8 passed", "no product code in scope (drive-harness only)": "changed_files are e2e fixtures + STATUS.md only" }, "summary": "sshDroplet/sshDropletInteractive now pin a per-run known-hosts store so the nixos-anywhere takeover's mid-drive host-key change no longer reds the branded-chrome occ dial.", "blockers": [] } ``` </details>
Author
Owner

close-report for #569 — status success

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

envelope
{
  "issue": 569,
  "status": "success",
  "commits": [
    "1f0bcb6"
  ],
  "changed_files": [
    "app/tests/e2e/fixtures/droplet.ts",
    "app/tests/e2e/fixtures/droplet.test.ts",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "npx vitest run tests/e2e/fixtures/droplet.test.ts",
      "exit_code": 0
    },
    {
      "command": "npx vue-tsc --noEmit -p tsconfig.json",
      "exit_code": 0
    },
    {
      "command": "npx eslint tests/e2e/fixtures/droplet.ts tests/e2e/fixtures/droplet.test.ts",
      "exit_code": 0
    }
  ],
  "criteria": {
    "sshDroplet no longer pins the operator default known_hosts (fix)": "droplet.ts knownHostsFile() adds -o UserKnownHostsFile on both dials, OC_E2E_KNOWN_HOSTS or /dev/null",
    "sshDropletInteractive gets the same isolation (same exposure)": "droplet.ts -tt dial threads UserKnownHostsFile; test 'threads the OC_E2E_KNOWN_HOSTS store into the -tt dial'",
    "accept-new + BatchMode preserved (refuse-on-change within a leg)": "droplet.ts keeps StrictHostKeyChecking=accept-new + BatchMode=yes unchanged; test asserts accept-new present",
    "option assembly unit-tested (droplet.test.ts)": "3 new tests: env threaded, /dev/null fallback, interactive dial; vitest 8 passed",
    "no product code in scope (drive-harness only)": "changed_files are e2e fixtures + STATUS.md only"
  },
  "summary": "sshDroplet/sshDropletInteractive now pin a per-run known-hosts store so the nixos-anywhere takeover's mid-drive host-key change no longer reds the branded-chrome occ dial.",
  "blockers": []
}
**close-report** for #569 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 569, "status": "success", "commits": [ "1f0bcb6" ], "changed_files": [ "app/tests/e2e/fixtures/droplet.ts", "app/tests/e2e/fixtures/droplet.test.ts", "STATUS.md" ], "tests": [ { "command": "npx vitest run tests/e2e/fixtures/droplet.test.ts", "exit_code": 0 }, { "command": "npx vue-tsc --noEmit -p tsconfig.json", "exit_code": 0 }, { "command": "npx eslint tests/e2e/fixtures/droplet.ts tests/e2e/fixtures/droplet.test.ts", "exit_code": 0 } ], "criteria": { "sshDroplet no longer pins the operator default known_hosts (fix)": "droplet.ts knownHostsFile() adds -o UserKnownHostsFile on both dials, OC_E2E_KNOWN_HOSTS or /dev/null", "sshDropletInteractive gets the same isolation (same exposure)": "droplet.ts -tt dial threads UserKnownHostsFile; test 'threads the OC_E2E_KNOWN_HOSTS store into the -tt dial'", "accept-new + BatchMode preserved (refuse-on-change within a leg)": "droplet.ts keeps StrictHostKeyChecking=accept-new + BatchMode=yes unchanged; test asserts accept-new present", "option assembly unit-tested (droplet.test.ts)": "3 new tests: env threaded, /dev/null fallback, interactive dial; vitest 8 passed", "no product code in scope (drive-harness only)": "changed_files are e2e fixtures + STATUS.md only" }, "summary": "sshDroplet/sshDropletInteractive now pin a per-run known-hosts store so the nixos-anywhere takeover's mid-drive host-key change no longer reds the branded-chrome occ dial.", "blockers": [] } ``` </details>
ben closed this issue 2026-08-15 05:51:47 +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.

Reference
Matou/idss#569
No description provided.