73 points · by thcipriani · 2y ago · 53 comments
Why use git over https then?
This isn't just an issue during initial set-up. If the Git host rotates their keys, it will need the client to accept the new keys. If your developers are sloppy and unthinkingly approve the new fingerprint, that means they're vulnerable to a MitM attack at any moment; presumably they'd unthinkingly approve an attacker's fingerprint too.
With HTTPS, you inherit the web's CA model, and it's pretty much secure-by-default.
Also, when you’re asked to verify the fingerprint, you can copy and paste the matching one from that known-good list instead of blindly typing “yes.” That way SSH will do the comparison for you.
If you do this, your usage of SSH with Github is as good as TLS (since the fingerprints are served via TLS).
Is this a UI issue to some extent? Its easy to type "y"/click yes to accept a changed finger print, but takes effort to type "Verify=false" (if I have got that right) to accept a bad certificate.
The problem right now is that if you rotate keys frequently your users get desensitized to the scary message and end up following the drill to delete the current key and connect with the new one. With a secure signing chain for rotating keys you avoid this problem.
Defaulting to HTTPS just because it is easier for them feels like a no-solution, but I could be generalizing. Maybe you are talking about developers in training or L1 levels.
And store the keys on a yubikey (OpenPGP or more modern Fido2) so they can't be exfiltrated. A huge benefit over a password.
And if you really want, SSH certificates are a thing too.
Briefly, HTTP is more flexible. For authentication, you could use passwords or OAuth.
https://www.gameoftrees.org/gotsh.1.html
Obviously not a good idea for repositories that you want to keep private. But it is odd to me how rare it is for public repositories.
Also, cloning private repo via http is a pain, when MFA is involved
~ $ git remote -v
origin https://github.com/mycompany/myproject.git (fetch)
origin https://github.com/mycompany/myproject.git (push)
~ $ git remote remove origin
~ $ git remote add origin git@github.com:mycompany/myproject.git
~ $ git remote -v
origin git@github.com:mycompany/myproject.git (fetch)
origin git@github.com:mycompany/myproject.git (push) git remote set-url origin git@github.com:...
Or using URL replacements in git config.A big repo clone from Github to here in Australia takes about half the time over https when compared with ssh. I'm not sure if github has region-located repos.
Somewhat related: SourceHut blog post on them optimising Git operations over SSH: https://sourcehut.org/blog/2019-11-22-what-happens-on-git-pu...
git clone ssh://git@ssh.github.com:443/rtyley/small-test-repo.git
instead of: git clone git@github.com:rtyley/small-test-repo.gitI couldn't imagine living without ssh.
I hated the policy because I loved outbound ssh tunnels to get around blocked websites (ie, no gmail). But I kind of understand it because dumb people will do dumb things and they can’t differentiate people who will use appropriate judgement.
But I’ve found that eventually every large org I’ve worked for ends up blocking ssh.
rm -rf /usr/local/libexec/git-core/git-credential-cache*
If it doesn't require shared secrets, this isn't scary, the git mechanism works just fine.
that's ... one of the dumbest thing I've ever read
They're a classic "Worse is better" like C where their principle advantage is simplicity of implementation. Sure, they're terrible, but look easy it was!
How can shared secrets be a bad idea? I mean, it was considered pretty good a thousand years ago, can technology really have improved since then? [Hint: yes, drastically]