August 3rd, 2024

Git: The Stupid Password Store

Tyler Cipriani shares his experience with Git, emphasizing secure credential management. He recommends using tools like GerritLab and secure options like `osxkeychain` or `libsecret` for password storage.

Read original articleLink Icon
Git: The Stupid Password Store

Tyler Cipriani discusses his experience with Git and the challenges of managing credentials securely. After using GitLab merge requests, he found them frustrating until he discovered GerritLab, a tool for stacked merge requests. To enhance security, he wanted to store his GitLab token in a password vault instead of in cleartext. He implemented a change in GerritLab to utilize git credentials, which allows for secure password management. The process involves using the command `git credential fill` to retrieve credentials and `git credential approve` to save them for future use, thus eliminating the need to repeatedly enter passwords when pushing to HTTPS remotes.

Cipriani highlights the complexity of Git's credential system, which includes various commands and helpers, such as `git-credential-cache` and `git-credential-store`. He warns against using `git-credential-store` due to its insecure storage of passwords in cleartext. Instead, he recommends using more secure options like `osxkeychain` for Mac users or `libsecret` for Linux users. He provides instructions for configuring these credential helpers, emphasizing the importance of selecting a secure method for managing passwords. By properly configuring Git credentials, users can streamline their workflow and enhance security when interacting with remote repositories.

Link Icon 6 comments
By @maratc - 6 months
> With git over ssh, you use your keys.

Why use git over https then?

By @zeitlupe - 6 months
hunter2 still gives me a smile
By @rswail - 6 months
AWS CodeCommit (just been deprecated btw), has a credential helper that allows you to use IAM role/policies instead of SSH keys.
By @SURA - 6 months
tar -zxvf git-2.46.0.tar.gz cd git-2.46.0 make configure ./configure --prefix=/usr/local make sudo make install

rm -rf /usr/local/libexec/git-core/git-credential-cache*

By @tialaramex - 6 months
If a system relies on "passwords" (or any similar shared secret scheme) it clearly doesn't really care about security. Yes that includes your bank.

If it doesn't require shared secrets, this isn't scary, the git mechanism works just fine.