r/github • • Jul 25 '24

isn't this kinda weid?!

Post image
111 Upvotes

33 comments sorted by

154

u/[deleted] Jul 25 '24

GitHub doesn't verify commit metadata. You can even put other people's email and name.

Which is why you should sign your commits :)

28

u/Zanger67 Jul 25 '24

What does signing your commits mean? Would it be like commenting on the commit or :0

49

u/adarshsingh87 Jul 25 '24

gpg key signing using the `-S` flag in the commit command. Read through the "verify commit signature" section here

15

u/Masterflitzer Jul 25 '24

can even sign with ssh key these days (way easier to setup if you're using ssh anyway)

5

u/Kirides Jul 25 '24

Ssh keys never expire. Gpg keys do. (Mine do once a year f.ex)

This way if a certain key would to be compromised I can revoke it, or just don't care if the key was expired anyways

3

u/Masterflitzer Jul 25 '24

my ssh private key doesn't leave my device and i don't want it to expire tho

1

u/Kirides Jul 25 '24

You do you.

Takes a single mishap and you'll never know for how long people will sign things in your name.

3

u/CelDaemon Jul 25 '24

Fair, you can always just revoke the signing key though (if you're aware of it happening)

1

u/Masterflitzer Jul 26 '24

well i can just change my ssh key, and remove it from my authorized signers list (be it in github, gitlab or ~/.ssh)

then that signature is no longer valid, no matter if people can sign with that key

1

u/tankerkiller125real Jul 25 '24

My gpg key doesn't expire, however it's also stored on a Yubikey, so the secret key can never ever be exported or otherwise stolen as far as I'm aware and from what I can find in research.

1

u/Masterflitzer Jul 26 '24

good method, but i am not a fan of hardware keys, i like having everything in my password vault, so i am mainly using passkeys if possible

i know i am sacrificing security, but i can't bring myself to carry around a hardware key, i have one, but i would only use it, if i could use it for 100% everything and wouldn't need a password anymore

1

u/Zanger67 Jul 26 '24

Tyyyy good to know

29

u/young_horhey Jul 25 '24

Include a picture of your signature as a new file each time you commit

4

u/nekokattt Jul 25 '24

Also upload the last four digits of your credit card and your mother's maiden name in the README.md so people can be sure it is you.

2

u/Solomoncjy Jul 25 '24

Search up github gpg signing

1

u/tsoonami7 Jul 29 '24

Signing the commit won't create a verified timestamp. To get a timestamp for your commit, you can use the vBase Python API to sign your code or commit hash. app.vbase.com

1

u/[deleted] Jul 29 '24

It does, signing commit signs everything. Including the timestamp.

The purpose of signing commit is not to prevent insider risk, but rather to prevent external threats. In most organizations, you would still have a centralized trust model.

1

u/tsoonami7 Jul 29 '24

I’m not sure I understand. If the timestamp of a commit is arbitrary and can be altered before signing/commitment, why does signing make it verifiable?

1

u/[deleted] Jul 29 '24

Because the concern is not about the author themselves altering it.

We fully trust the author. Same idea as signing binaries, you fully trust the author.

1

u/tsoonami7 Jul 30 '24

Understand now. Thanks!

41

u/HLingonberry Jul 25 '24 edited Jul 25 '24

Sure you can commit fake metadata, but looking at the repo in OPs post, the code is likely that old and has been converted from a CVS or SVN repo before git, thus the metadata is actually correct even if it wasn’t hosted in git/GitHub at that time.

10

u/drawkbox Jul 25 '24

converted from a CVS or SVN repo before git

SVN came out in 1995

Concurrent Versions System (CVS) was 1990

I am with you, probably a project from SVN right at inception or maybe CVS.

SVN was such an improvement over CVS.

Pour some out for the homies that needed to use Visual Source Safe (VSS). On a random Tuesday the index corrupts and there goes the code.

8

u/JackDeaniels Jul 25 '24

You could commit in future dates too

6

u/enisn Jul 25 '24

I can even push a commit from back to 1970. Why it should be weird? GitHub doesn't have any validation for commits, you can push whatever you want. If you create a commit locally, then you can push exactly the same to GitHub

2

u/[deleted] Jul 25 '24 edited Jul 25 '24

Check this one out lol https://github.com/narad-muni/future Never messed with it but maybe setting the machine time to the past and committing with Git can do that

2

u/Gullible_Method_3780 Jul 25 '24

You can even write small programs to create commits for past days and current days to fill out your heat map. If that’s your thing.

1

u/Ender-Wang Jul 25 '24

Can we use SSH for signing in vscode? Still not?

1

u/[deleted] Jul 26 '24

[removed] — view removed comment

1

u/Ender-Wang Jul 26 '24

Yeah, I did a little digging and arrived at gpg for signing.