On 2022-11-08 at 10:50:33, M Hickford wrote: > Among StackOverflow users [1], git-credential-store appears several > times more popular than any other credential helper. Does this make > anyone else uneasy? The docs warn that git-credential-store "stores > your passwords unencrypted on disk" [2]. Are users sacrificing > security for convenience? I definitely think there are better approaches. However, none of the credential managers for the three major platforms work without a desktop environment, so if someone's logging in over SSH, then there's no more secure option that's going to work for them. Taylor did mention GCM, but I believe it has the same problem, and even if it didn't, it's written in C#, which isn't portable to many Unices and isn't viable on servers anyway due to dependencies. Even on Linux desktops, Debian and Ubuntu don't ship the libsecret credential helper, so users have to build it themselves. I have written a tool that lets you access credential helpers on your local machine over an SSH session for trusted machines[0], but it's very preliminary. In the ideal world, we'd ship an encrypted store that people could use, but then we have to deal with export regulations and sanctions and nobody wants to do that. We'd also have to deal with multiple cryptographic libraries for portability and license reasons and nobody wants to do that, either. > Firstly, how grave is storing credentials in plaintext? Software > development guidelines such as CWE discourage storing credentials in > plaintext [3]. Password managers in desktop environments, mobile > operating systems and web browsers typically encrypt passwords on disk > and guard them behind a master password. I think there's space for credential managers that operate with major password managers. Unfortunately, op (the 1Password CLI) isn't open source, although LastPass has an open-source CLI. If Firefox and/or Chromium can offer command-line functionality to access the password manager, those could be supported. Such a tool would probably live outside of Git's codebase because I think interacting with some of those tools requires parsing JSON, which we won't want to do in C. > Secondly, the docs recommend git-credential-cache [2] which ships with > Git and is equally easy to configure. So why isn't it more popular? My > hypothesis: while caching works great for passwords typed from memory, > the combination of caching with personal access tokens has poor > usability. The unmemorised token is lost when the cache expires, so > the user has to generate a new token every session. I suspect GitHub's > 2021 decision to stop accepting passwords [4] may have inadvertently > pushed users from 'cache' to 'store'. That may be the case, but I'd much rather people use tokens instead of passwords because they're much more limited and can easily be revoked (or can even just expire). We know that people are very bad about reusing passwords all over the place, so in the event people do compromise their credentials, they're substantially more limited. > Thirdly, why doesn't everyone use SSH keys? Unlike HTTP remotes, > upfront set-up is necessary to clone a public repo. For users > unfamiliar with SSH, this set-up may be intimidating. Introducing > users new to Git to SSH at the same time is a significant cognitive > load. SSH keys are also more difficult to make work with multiple accounts, and judging from my experience on StackOverflow, that's not an uncommon situation to be in. I have diligently added entries in the FAQ to cover this, but in general people don't read it unless specifically directed there. I do think SSH keys in general work well for forwarding to other machines, but in a decent number of corporate environments there are intercepting proxies so everything has to be HTTP. [0] https://github.com/bk2204/lawn -- brian m. carlson (he/him or they/them) Toronto, Ontario, CA
Attachment:
signature.asc
Description: PGP signature