Skip to content

Pin the nodes' SSH host keys so CI can verify them - #318

Merged
anuveyatsu merged 1 commit into
mainfrom
bead/ci-deploy-pins-host-keys
Sep 13, 2026
Merged

Pin the nodes' SSH host keys so CI can verify them#318
anuveyatsu merged 1 commit into
mainfrom
bead/ci-deploy-pins-host-keys

Conversation

@anuveyatsu

@anuveyatsu anuveyatsu commented Sep 13, 2026

Copy link
Copy Markdown
Member

The first CI deploy (#317) reached SSH and failed on "Host key verification failed" -- strict host-key checking is on and a fresh runner has no cached keys, so it correctly refused an unknown host.

The keys are now pinned in infra/ansible/known_hosts, and ansible.cfg points UserKnownHostsFile at it with strict checking. This strengthens things: CI and every laptop verify against the same committed keys instead of trusting whatever each operator accepted first. The connection is already authenticated end-to-end by Cloudflare Access before SSH; this closes the last gap without turning checking off.

Public keys, safe to commit. A reprovision changes a key and fails the deploy loudly here until the file is updated -- correct, not a silent accept-new.

Verified: ansible all -m ping returned pong from both nodes through the pinned known_hosts.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Security
    • SSH connections now use strict host-key checking.
    • Added pinned host keys for staging servers, improving verification during first-time connections.
    • Host-key updates are documented for reprovisioned nodes.

The first CI deploy got all the way to SSH and failed on "Host key
verification failed": host_key_checking is on, and a fresh runner has
no cached keys, so strict checking correctly refused an unknown host.

The keys are now pinned in infra/ansible/known_hosts and ansible.cfg
points UserKnownHostsFile at it with StrictHostKeyChecking=yes. This
does not weaken anything -- it strengthens it: CI and every laptop now
verify against the same committed keys, instead of trusting whatever
each operator accepted on first connection. The connection was already
authenticated end-to-end by Cloudflare Access before SSH; this closes
the one remaining gap without turning checking off.

They are public keys, safe to commit. A reprovision changes a node's
key and fails the deploy loudly here until the file is updated -- which
is the correct behaviour, not a silent accept-new.

Verified: `ansible all -m ping` connects to both nodes through the
pinned known_hosts (pong from control and execution).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 891bb3c6-6678-49df-9949-13b82b1878ec

📥 Commits

Reviewing files that changed from the base of the PR and between 37dff50 and a0546c2.

📒 Files selected for processing (2)
  • infra/ansible/ansible.cfg
  • infra/ansible/known_hosts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Ansible now enables strict SSH host-key checking and uses a repository-provided known_hosts file. The file pins ed25519 keys for the staging and execution hosts.

Changes

SSH host-key verification

Layer / File(s) Summary
Configure pinned host keys
infra/ansible/ansible.cfg, infra/ansible/known_hosts
Ansible uses known_hosts with strict host-key checking. The new file pins ed25519 keys for ssh-staging.openbases.com and ssh-exec-staging.openbases.com.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to a0546

The pinned host-key configuration is consistent with the supported CI and developer deployment commands.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: pinning the nodes' SSH host keys so CI can verify them.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bead/ci-deploy-pins-host-keys

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@anuveyatsu
anuveyatsu merged commit 320b660 into main Sep 13, 2026
7 checks passed
@anuveyatsu
anuveyatsu deleted the bead/ci-deploy-pins-host-keys branch September 13, 2026 17:56
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