11 ms·
Improving Git protocol security on GitHub
- remram 5y ago"Git protocol" to me means git://, and they are not really improving this one so much as removing it.
- zoobab 5y ago"Turning off the unencrypted Git protocol" They are killing it instead.
- cuspycode 5y agoNatural language is sometimes ambiguous. I read "Git protocol security" as the protocol security of network protocols related to Git in general. They are deprecating the internal git protocol (tcp on port 9418) entirely, and changing the requirements for using the ssh protocol (tcp on port 22).
- er4hn 5y agoExec Summary: No actual changes to how the protocol itself works. Github is requiring modern keys + algorithms for git over SSH connections and removing the unencrypted git protocol as a connection option. Seems reasonable to me. Since github is a git-as-a-service provider it makes sense to do this. From the headline I had thought they were making their own variant on the git protocol.
- mistrial9 5y agothe other side of this coin is that ssh key access is controlled and recorded more carefully, with more options to disable and ban.
- duskwuff 5y agoWhat are you trying to imply here? SSH is used to authenticate to GitHub as a specific user. GitHub can use this for access control and logging. This isn't new or surprising. If you don't want to authenticate to GitHub as a specific user, you can clone repositories over HTTPS. This isn't new either. You can't authenticate over HTTPS anymore, but if you were concerned about being "controlled and recorded", you weren't doing that anyway.
- TimWolla 5y ago> You can't authenticate over HTTPS anymore You can, just no longer using username and password. Instead you must use an access token.
- hunter2_ 5y agoFor accounts without MFA enabled (which are the only ones who were able to use username/password via https in the first place), is the token granted after supplying just username and password, and if so, what's the real improvement? I see here [0] a few benefits listed: > Unique – tokens are specific to GitHub and can be generated per use or per device > Revocable – tokens can can be individually revoked at any time without needing to update unaffected credentials > Limited – tokens can be narrowly scoped to allow only the access necessary for the use case > Random – tokens are not subject to the types of dictionary or brute force attempts that simpler passwords that you need to remember or enter regularly might be ...but if you can trivially obtain it by supplying username/password, then it's effectively equivalent anyway. [0] https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ https://github.blog/2020-12-15-token-authentication-requirem...
- jfrunyon 5y agoYou can not obtain the username/password from the token.
- hunter2_ 5y agoAh, that makes sense, for the case of losing control of (e.g., accidentally committing) the git connection credentials: better to just revoke a token than rotate the password after having potentially also lost control of whatever else uses the same password.
- buu700 5y agoFrom the headline I had thought they were making their own variant on the git protocol. To be fair, extending, extending, and extinguishing does sound like something Microsoft might do.
- peakaboo 5y agoYup I was fully expecting this from the headline.
- buu700 5y ago(*embracing)
- pjmlp 5y agoOn the other hand, had Google bought Github instead, most likely the service would no longer exist.
- froh 5y agowhy do you think so?
- pjmlp 5y agoDo I really need to answer it? https://killedbygoogle.com/ https://killedbygoogle.com/ https://gcemetery.co/ https://gcemetery.co/
- dorianmariefr 5y agoOr it would be used by billions
- spixy 5y ago1. GitHub Inc. is independent from Microsoft 2. EEE is dead (at least in MS)
- traverseda 5y agoI presume this is for user tracking? You can track users based on their SSH keys.
- johncolanduoni 5y agoHow would you correlate that with anything to produce useful data? GitHub already knows what repos an SSH key has access to, and usually read-only access to a public repo for which you don’t have write permission is done with HTTPS.
- Arnavion 5y ago>and usually read-only access to a public repo for which you don’t have write permission is done with HTTPS. I don't know if this is the case. I always clone with `github.com:owner/repo` remotes, because it's shorter and saves me the effort of doing things differently based on whether it's my repo or not.
- mishafb 5y agoThey already know everything you do on the site...
- scrollaway 5y agoWhat's the line of thinking that led you to believing a change like this would be for user tracking? (Seriously asking by the way, this isn't a put-down. MS isn't in the ad business, let alone Github, and these changes primarily affect people who are logged in, so … no idea how you can make the leap)
- unbad505 5y agoThey aren't removing https cloning.
- zerocrates 5y agoI kind of liked having git:// as the option where no authentication was possible. Oh well.
- psanford 5y agoYou can still use https:// https:// for unauthenticated access to public repos.
- zerocrates 5y agoI know, but it's just, with git:// you know you're getting the "anonymous user" experience, so when things work for instructions or submodules or whatever you know it's not just because of your own saved credentials. If your repo is accidentally private, a git:// URL is just going to give you an error right away. Not a big deal but just something that to my knowledge you won't be able to do going forward.
- duskwuff 5y agoLiterally all of these things are also true of https:// https://.
- deleted 5y ago[deleted]
- codys 5y agohttps supports having credentials provided by various providers (and `.netrc`, for example). Which means when using https you don't know you're getting the anonymous user experience (because it's likely using credentials from other sources)
- zerocrates 5y agoI really only said one thing, and I'm pretty sure it's not true of https URLs under common configurations when you've stored your credentials. What I'm talking about is this: with a git:// URL, if you plug it into Git and that repo is private, you just get "Repository not found" immediately. With an HTTPS URL, if you're routinely using HTTPS for Git, you probably have credentials saved and you might miss that something's not publicly accessible which should be. Further, if you do have some problem like this then the issue's arguably less clear, as the behavior of a private or simply nonexistent HTTPS repo URL for users without saved credentials is to prompt for login, which can be confusing, making a user think they need a Github account or that there's some problem with theirs. Like I said though, it's not really a big deal.
- notanog 5y agois AES256-CBC insecure? unfortunately i encrypt backups with it.
- ZeroCool2u 5y agoI've been out of the security game for a while, but a couple years ago the rule of thumb was to avoid CBC and use GCM. Edit: There's a good explanation here https://crypto.stackexchange.com/questions/2310/what-is-the-difference-between-cbc-and-gcm-mode https://crypto.stackexchange.com/questions/2310/what-is-the-...
- tomudding 5y agoWhile theoretically secure, CBC ciphers are considered weak because of their implementation. They are more often than not vulnerable to padding oracle attacks. These issues have been around for more than a decade, but they keep popping up. The last 3-ish years a larger push has been made to disable CBC ciphers (in SSL/TLS, SSH, etc.). See [0, 1, 2, 3, and 4] for more information. GCM/CTR is considered to be a more secure alternative. [0]: https://en.wikipedia.org/wiki/Padding_oracle_attack#Padding_oracle_attack_on_CBC_encryption https://en.wikipedia.org/wiki/Padding_oracle_attack#Padding_... [1]: https://www.openssh.com/txt/cbc.adv https://www.openssh.com/txt/cbc.adv [2]: https://ieeexplore.ieee.org/document/5207634 https://ieeexplore.ieee.org/document/5207634 (is CPNI-957037) [3]: https://alicegg.tech/2019/06/23/aes-cbc.html https://alicegg.tech/2019/06/23/aes-cbc.html [4]: https://docs.microsoft.com/en-us/dotnet/standard/security/vulnerabilities-cbc-mode https://docs.microsoft.com/en-us/dotnet/standard/security/vu... [n]: You can find more information with a quick search, this also includes security advisories from HPE, RedHat, IBM, and F5.
- bawolff 5y agoThat said, i don't think padding oracles are usually available in the context of an encrypted backup, so that particular concern is probably not a big concern in OP's usecase.
- hannob 5y ago"It's complicated". CBC does not provide authentication, thus it does not protect your encrypted content from manipulation (which can enable all kinds of followup attacks). Generally you should avoid using unauthenticated ciphers almost always and use an AEAD. SSH uses CBC in combination with a MAC, so it has authentication, but it combines them in an insecure way. It turns out it's practically impossible to avoid these attacks (there had been countermeasures, but it's been shown that they can be circumvented). The attacks only let an attacker decrypt a single byte in certain situations, so the practical impact is limited. Here's the original attack: https://www.isg.rhul.ac.uk/~kp/SandPfinal.pdf https://www.isg.rhul.ac.uk/~kp/SandPfinal.pdf Here's an updated paper that shows that the countermeasures against the original attack don't work. https://www.isg.rhul.ac.uk/~kp/surfeit.pdf https://www.isg.rhul.ac.uk/~kp/surfeit.pdf
- newman314 5y agoI didn't think that ed25519 support was new. AFAIK, I've used an ed25519 key with GH for a few years now.
- dancsi 5y agoNow they have added it for host keys.
- newman314 5y agoAhah! Thanks for pointing that out. Need more coffee.
- lights0123 5y agohost keys. > GitHub hasn’t traditionally offered these as host keys (server keys), but we’ll be offering them as options in the future.
- arthurcolle 5y agoWas the whole password to SSH key switch annoying at all for anyone else? Like procedurally its simple but I have a bunch of accounts, a bunch of different repos. It just felt annoying even if the end-result desire for the system operator (GitHub) is maybe desirable... ("our users are better off according to our definitions of security") Let me use a password if I want, these security requirements are becoming increasing absurd - I could realistically see people just checking out of services if these invasive procedures continue. Just kidding, a lad can dream. Yeah it's not rocket surgery to add the ssh key and then clone it to your different machines but if you have strict sprint deadline or something and you haven't pulled from your repo in a day and suddenly you can't run your workflow, then that's really pretty annoying to have to run the context switch and do some random bullshit to appease your vendor's obnoxious requirements. If Millenials ever learn software engineering en-masse maybe they would decry this lack of consent in daily software engineering operations. (Haha jk... not really, but I'm a Millenial so it's ok for me to say this) Passwords are 100% the weakest link in our beep boop chain of trust, of course - we know this. But maybe they should just be rethought from the ground up instead of randomly affecting your users all the time with security nonsense. EDIT: WOW speak of the devil, I literally just received an email saying on of my earlier keys is about to expire (personal account vs my employer GitHub account). Seriously shoot me in the face, why do I have to constantly update stuff to comply with requirements without getting paid? Just kidding, but almost not. :rage_face:
- generationP 5y agoI have still not figured out how to use the new system from the command line. And I am generally rather familiar with git, just not with ssh. Ended up switching a repo to public just in order to be able to use it. Maybe I should try again and hope there are better tutorials around now than a month ago. The Anubis school of infosec https://external-preview.redd.it/-zmkMWw8GlL5REUZmtcKIPj9PtYLETyr_egrg-LuSfU.jpg?auto=webp&s=b9c78f2d5e2d5554305c78c26e9bb60f43b7e878 https://external-preview.redd.it/-zmkMWw8GlL5REUZmtcKIPj9PtY... is strong on this one.
- arthurcolle 5y agoSorry I'd tell you how I do it but for OPSEC reasons I cannot... Haha just kidding, here what's up - this is what a friend of mine does that has nothing to do with my own operations of course. Probably violating many contractual arrangements bigly but honestly the whole security side of this stuff is so anal retentive that I will, for the greater good of my boy generationP. You just go into your dev settings on GitHub. (Top right when youre on GitHub.com, dev profile pic, click on Settings then on Developer Settings, then you'll be confused because it asks you to register a dumbass GitHub app - ignore this) Then click on "Personal access tokens" on the lower left of the left most menu. Then generate with the desired permissions (wow, guess what most people will select in a rush...? shocking, unimaginable...) Anyways once you have the token, which will only be generated once, so save it down - I just make a environment variable and export it because I have a finite amount of time in my life and this stuff beyond annoys me. The just repoint your local repo clones to an instance with the following convention: git://<username>:<personal_access_token>@github.com/<username OR orgname>/<repo name> Good luck, old sport. Post on here if you have any problems. You can also modify all the crap in your .git subdirectory within a repo but that's deep in the danger zone.
- dfawcus 5y agoTurning off unencrypted raw git protocol will be a pain. I generally use that for grabbing stuff for inspection & evaluation as on a number of my machines, https protocol does not work (seemingly due to only supporting older versions of TLS). I have not upgraded those machines for 'reasons'. It can be worked around by grabbing on a newer machine, then cloning from there, but that is extra hassle. Ho hum. (Given the Merkle hash format of the git repo's, there is really little or no need for an encrypted connection when fetching from a public repo).
- aseipp 5y agoAs usual the problem is MITM. Any clone for git://github.com/foo/bar.git can easily be intercepted to git://github.com/evil-foo/evil-baz.git, or fetch, etc. The middleman can also do freeze attacks (i.e. prevent 'git fetch' from ever succeeding) and other such things. Almost all git workflows implicitly assume that both A) the upstream is 'correct' and therefore trusted. A corollary of this is that B) the transport to that upstream must also be secure, so you are sure it really is the upstream you wanted. A merkle tree is only useful after this chain of trust is established. The only exception is if you know the commit hash a priori perhaps, and fetch that explicitly. But you often don't; even assuming most Git/GitHub workflows did know that, you're just passing the buck because to verify that commit hash is authentic you have to use some other secure channel, and that's often HTTPS.
- dfawcus 5y agoActually it is trivial to prove it was correct. My workflow was to look at the site with a web browser (with working up to date TLS), and note the hash of the final commit of master. This can be done on a different machine. Then one clones the repo from the non https capable machine, and verifies the hash for the tip of master. Rinse and repeat for any other branches of interest, especially if only performing a limited clone.
- dfawcus 5y agoNow the sadly amusing aspect of all this is that I only noticed the https issue in the first place, because I'd previously cloned some repos on the machine using it. Then some time later when doing a fetch, I received a TLS nego rejection complaint. Github had turned off support or earlier versions TLS, and the machine in question did not implement the later version. (I believe this was on an old macOS version). So as a workaround, I altered the refspec in the git config file to switch to using the raw git protocol. i.e. their earlier 'improve security' measure drove me to switch to the 'improved' unencrypted git protocol. :-)
- floatboth 5y agoA whopping 0.3% of requests were using ssh-dss? That's quite a lot. Why did anyone ever make those keys?
- banana_giraffe 5y agoNever underestimate how long a bad tutorial can float around: https://www.siteground.com/kb/how_to_generate_an_ssh_key_on_windows_using_putty/ https://www.siteground.com/kb/how_to_generate_an_ssh_key_on_... This site isn't where I first saw this. This isn't the top hit for any search term I can come up with, but it is often on the first page of hits. So people do silly things without understanding what they're doing. (To give somewhat of a feeling for age here, the exact wording from that tutorial is at least 5 years out of date. Putty changed the UI a bit in 0.68)
- 0xbadcafebee 5y agoLast I checked, GitHub still refused to update their SSH key generation documentation to include instructions on using the "new" openssh key format, leaving users with insecure private keys. The argument for why, according to every vendor I've reported this to, is their users are stupid and will get confused by the strange new detail that if their key is copied to a server that hasn't been upgraded in 8 years, that server might not be able to read the private key [locally]. It is much easier to just use the insecure defaults. For an SSH key.
- sofixa 5y ago> a server that hasn't been upgraded in 8 years, that server might not be able to read the private key It's not that bad actually. Debian 9, still supported and updated, does not accept RSA SHA2 keys or certificates.
- xorcist 5y agoThat's a bit of a stretch (pun intended). The release page clearly says "Security updates have been discontinued as of July 6th, 2020" and that updates are only available through long time support. That said, according to packages.debian.org it ships with OpenSSH 7.4 and support for sha2 have been included since 7.2. And ed25519 has been included since 6.5, so you should be fine.
- sofixa 5y ago> That's a bit of a stretch (pun intended). The release page clearly says "Security updates have been discontinued as of July 6th, 2020" and that updates are only available through long time support. Yeah, but LTS is still support :P > That said, according to packages.debian.org it ships with OpenSSH 7.4 and support for sha2 have been included since 7.2. And ed25519 has been included since 6.5, so you should be fine. You'd think that, but Debian do their own thing. I don't recall the exact versions, but the Include directive for sshd_config should be present in the version shipped in Debian 9, but isn't[0]. I can't find the exact listing, but for instance you can see that `ssh-keygen` in Debian 9, of version 7.4, doesn't support rsa-sha2[1]; it does support `ed25519` however. 0 - https://manpages.debian.org/stretch/openssh-server/sshd_config.5.en.html https://manpages.debian.org/stretch/openssh-server/sshd_conf... 1 - https://manpages.debian.org/stretch/openssh-client/ssh-keygen.1.en.html https://manpages.debian.org/stretch/openssh-client/ssh-keyge...