|
|
Subscribe / Log in / New account

Garrett: We need better support for SSH host certificates

Garrett: We need better support for SSH host certificates

Posted Mar 24, 2023 21:43 UTC (Fri) by geofft (subscriber, #59789)
In reply to: Garrett: We need better support for SSH host certificates by flussence
Parent article: Garrett: We need better support for SSH host certificates

Public keys are public, though. https://github.com/geofft.keys lists all the keys that GitHub knows belongs to me, so anyone could "impersonate" GitHub to me if this were a thing the client tried to validate.

If you really wanted to go this route, you could add some additional secret that you create that GitHub has to prove to you - but this just goes further down the road of shared secrets, which Matthew is basically arguing is the whole problem here, and introduces symmetric crypto with inherent syncing problems. From experience at multiple sites that use Kerberos, which relies on symmetric crypto, key distribution is a giant pain and you basically need to copy private key material around when you have a fleet of servers load-balancing the same hostname, which puts you at immense risk of this sort of incident.

Instead, you want to lean harder on asymmetric crypto, add another layer of indirection, and have some sui-generis CA that signs the GitHub sshds, each one of which has its own key, and have the sshd send you the certificate and ask you to TOFU the CA's public key instead of the individual server's public key. Then each individual server can have its own keypair, the CA only needs to be brought online when provisioning a new server, and the only thing that needs to be sent across GitHub's internal network is public keys and public signatures of keys.


to post comments

Garrett: We need better support for SSH host certificates

Posted Mar 24, 2023 22:07 UTC (Fri) by flussence (guest, #85566) [Link]

> Public keys are public, though.

The load-bearing word here is “previously”: keys don't exist in a conceptual vacuum, there's a time component by way of them actually being used. A shared secret could be negotiated at first connection and stored near-but-separate-from authorized_keys/known_hosts for later use. An attacker trying to impersonate the server would then have to obtain that value for each user as well as the server's private key.

It only protects against the one specific case of accidentally posting a private key in public, but apparently that's a common enough one that there's several official and unofficial bots constantly monitoring GitHub to catch people doing it.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds