4 ms·
I know this isn’t about the signing really, but it is my understanding that you sign things with your private key and people can verify that it was you who sign
by mosselman 3y ago
I know this isn’t about the signing really, but it is my understanding that you sign things with your private key and people can verify that it was you who signed it with the matching public key.
Does this work differently with git?
- seeknotfind 3y agoThis is not a security issue. The key is just hard to update when it expires. Private is private, public is public, even in git.
- whirlwin 3y agoWhy does it need to be public? By revealing your public key you also reveal the algo used for your public/private keypair. If you are a renowned developer and have an insecure algo, you might be a victim for targeted attacks
- woodruffw 3y agoIf your goal is to have others verify your signatures, then they need to have your public key. The solution to using weak algorithms is to not use them, not to hide your public key. If you don’t reveal your public key, then there’s effectively no value in the signatures made by its private half.
- whirlwin 3y agoIsn't the best way to verify the integrity to use git signed commits? GitHub has great support for this
- woodruffw 3y agoYou’re mixing up integrity and authenticity: git provides integrity through its basic design; commit signing additionally adds authenticity (sort of). But again: you don’t actually get authenticity if you obtain the public key from the same untrusted channel as the signed material. The key has to come from another channel (another simplification, but true in PGP and git’s case). That channel can be the user’s GitHub profile, website, etc., but it can’t be the repository itself.
- lloeki 3y agoFun fact, just as SSH public keys for a user are readily publicly available on GitHub, gpg keys are as well curl https://github.com/${username}.keys curl https://github.com/${username}.gpg | gpg --list-packets Interestingly enough, since changing the GH keys is subject to GH authentication (possibly involving 2FA), the owner's key is kind of validated (by GH) so it _kind of_ makes GH a gpg key notary. Having `git log --show-signatures` validate _all_ signatures is then a matter of: curl https://github.com/${username}.gpg | gpg --import Now I kind of wish GH would sign such user pub keys _at the time they're added_ (thus at the time GH authentication is deemed valid), thus ensuring they've not been tampered with in between. With a bit of UI GH could present a UI for a user to validate another user's key, and sign that assertion (with a GH private key, not the user's of course) as well. Of course it hinges on trusting GH, but GH already signs e.g UI borne merge commits on your behalf (via https://github.com/web-flow.gpg https://github.com/web-flow.gpg) so there's that. Then next step would be for GH to host an actual key server to accept off-band signed keys containing a magic comment that bind the keys and sigs to GH usernames...
- lvc_ 3y agoIt doesn't necessarily need to be public in the global sense, but it is public in the sense of "you can't rely on keeping it secret as a security boundary". Since its used to validate the signature, it will usually need to be (at least) as public as the signed thing.
- pdpi 3y agoPublic key cryptography is pretty pointless if you don’t take advantage of the public part. One, you can’t send me any encrypted messages without my public key. Two, you can’t verify my signatures without my public key. Insecure algorithms are a red herring here too. Either I know what algo you used and can interact with you, or I don’t.
- upofadown 3y ago>If you are a renowned developer and have an insecure algo, ... Example of such an insecure algorithm that might be relevant here?
- WorldMaker 3y agoLow key sizes (<= 1024) of RSA are considered vulnerable, especially to quantum computer attacks. Some ECC curves are considered vulnerable, especially to NSA backdoors.
- woodruffw 3y agoIt’s a security issue in the sense that it defeats the signing scheme: rather than negotiating the key out-of-band, the user is trusting the thing they’re trying to verify to supply the key. In other words “trust me because I’m signed, and also trust me to give you the key I’m signed with.” On the other hand, approximately nobody actually verifies git commit signatures, so it doesn’t matter all that much :-)
- OJFord 3y agoI'm not really advocating for it, but GitHub does verify out of band - it uses keys on the profile. (If it says 'unverified', it doesn't match any that are present. If it says neither unverified nor verified, the commit wasn't signed.)
- jrms 3y agoI do. Deploys can only be rolled out if the tag was signed by a well known list of people (git pull --verify-signatures).
- WorldMaker 3y agoThe name `junio-gpg-key` is a lightweight tag in the git git repo. It's not that hard to update, though it requires both force push and force pull (to an existing clone, new ones get the latest value no matter what). It is something of a security risk because there is no audit log for force pushes and anyone with force push access to that repo could update that tag at any time. Also, because it is a lightweight tag, it is not itself signed so could potentially be man-in-the-middled. That said, yes it is a public key and public keys are meant to be public. In many threat models this isn't a "huge deal". The issue, as often the case, with public keys is that you still need a chain of trust somehow defining if you should trust that public key. A public key that you get from the repo itself that anyone could force push an update to is possibly not one you should trust without additional verification channels involved.
- LukeShu 3y agoNope, that's how it works with Git.
- woodruffw 3y agoNope, it’s the same. I believe the blog post is trying to say that including the key in the git object storage is effectively the same thing as self-signing, since there’s no independent key discovery or trust mechanism. In other words: it’s not because it’s a private key, but because putting a public key in the same channel that it’s meant to verify is essentially “useless” from a verification perspective.