11
Why would you want to sign your commits with PGP? Is SSH insufficient?
(programming.dev)
c/cybersecurity is a community centered on the cybersecurity and information security profession. You can come here to discuss news, post something interesting, or just chat with others.
THE RULES
Instance Rules
Community Rules
If you ask someone to hack your "friends" socials you're just going to get banned so don't do that.
Learn about hacking
Other security-related communities !databreaches@lemmy.zip !netsec@lemmy.world !securitynews@infosec.pub !cybersecurity@infosec.pub !pulse_of_truth@infosec.pub
Notable mention to !cybersecuritymemes@lemmy.world
If you're talking about
git config --global gpg.format ssh && git config --global user.signingKey ~/.ssh/your_key
and then signing your commit withgit commit --sign
then yeah, in modern times it's very similar to PGP signing. There are a couple minor differences which make PGP a bit better:If you're talking about using ssh for authentication to the git server, than it's a different story. First of all, most git servers will actually accept it if you push commits committed by someone else (e.g. see this: https://github.com/jayphelps/git-blame-someone-else). (there's a tangent about
Author:
vsCommitter:
that can be had, but in any case e.g. GitHub does not do any checks on either of those fields when you push commits there). And so, someone can just "pretend to be you" and push commits somewhere as though they have been created by you. There are of course some other mechanisms around that (e.g. access control to repositories) but it's still a problem. PGP/SSH signing (as opposed to ssh authentication) is the most effective solution to that. If some commit has been signed by you, and everyone knows your public key, they can verify for themselves that you are the committer. GitHub has a way to (semi)-enforce that: if you add your GPG/SSH key as a signing key and enable "Vigilant mode" (" Flag unsigned commits as unverified "), all commits that have you asCommitter
which aren't signed by your signing key will get marked as "Unverified" in their web interface and raise suspicion almost immediately.Of course this mechanism relies on GitHub (i.e. Microsoft) as the keyserver - they could in theory covertly replace your key with something else and most people would be none the wiser. Even if someone wanted to check themselves, for a project hosted on GitHub the most obvious way to find the persons PGP/SSH key is to request it from there (You can actually do that by going to
https://github.com/<username>.gpg
andhttps://github.com/<username>.ssh
- e.g. here's my PGP public key: https://github.com/balsoft.gpg), so you have to trust them not to replace it. It's better than nothing but not great. If you're serious about key signing, publish your key on your own website, with as much of it controlled by you as possible (ideally on your own hardware), and advertise it widely. E.g. my key is available at https://balsoft.ru/key.Fyi for point 2, you can sign with SSH key stored on a hardware token (e.g., yubikey).