Can a GitHub Actions deployment successfully SSH into the wrong server? #205659
Replies: 2 comments 6 replies
|
What actually stops it: SSH host key verification — comparing the server's host key/fingerprint against a known, trusted value. Credentials only authenticate you to the server; they say nothing about whether the server is the right one. If DNS points somewhere else and that machine accepts valid creds, auth succeeds regardless. Your instinct is correct — fingerprint checking is the right boundary. The catch: most CI pipelines defeat this without realizing it via:
Fix: pin the host's fingerprint/public key as a secret obtained once out-of-band, populate known_hosts from that pinned value (not ssh-keyscan at runtime), and keep StrictHostKeyChecking yes. Rotate the pinned value deliberately when infra changes. |
|
Nice question, and yes, SSH host key fingerprint verification is exactly the right boundary here, that's literally what it's designed to prevent. If DNS silently repoints Here's the mechanism: every SSH server has a host key, and the first time you connect, the client stores that key's fingerprint (usually in The catch in CI/CD specifically: many pipelines run with Fix: pin the expected host key explicitly in your deploy pipeline (a static |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
💬 Feature/Topic Area
Actions Checkout
Discussion Details
I'm thinking about a failure mode in SSH-based deployments.
Kinad DNS points deploy.example.com to a different machine than expected. The new machine accepts SSH connections, credentials are valid, and the deployment proceeds normally.
What actually prevents the deployment from continuing in this case?
Is checking the SSH host fingerprint against a trusted value the right boundary here, or am I missing something?
All reactions