I’m curious to hear what the Lemmy programming community thinks of this!


  • The author argues against signing Git commits, stating that it adds unnecessary complexity to systems.
  • The author believes that signing commits perpetuates an engineering culture of blindly adopting complex tools.
  • The consequences of signing Git commits are likely to be subtle and not as dramatic as some may believe.

Archive link: https://archive.ph/vjDeK

  • CameronDev@programming.dev
    link
    fedilink
    arrow-up
    4
    arrow-down
    2
    ·
    9 months ago

    I’ve never understood the point of signing commits. If i can push a commit to a repo, then i can also add my own keys to the repo as well right? So malicious actor with my password can happily push signed commits?

    Do many people actually sign commits?

    • MajorHavoc@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      9 months ago

      I don’t sign my commits.

      Though I’ll admit I’m not making a moral judgement, it was just a pain in the ass to setup last time I had the time to try it.

    • loakang@lemm.ee
      link
      fedilink
      arrow-up
      3
      ·
      9 months ago

      Unless they have access to your private key then there’s no way they can sign code as you.

      Alternatively yes, access to your password (and 2fa) would allow them the ability to add an ssh private key for you.

      But that’s irrelevant because the issue at hand is that I can make a commit to a repo that I have access to, but using your username, and there’s no way to verify it wasn’t you (actually there is but it requires some assumptions and is also dependent on the git hosting infrastructure)

      However when you use signing, key ‘A’ may be able to access a repo but can’t sign commits as key ‘B’, so you can’t have the blame dropped on you for malicious commits (again, unless they also compromised your account/key)

    • Mikina@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      9 months ago

      I use comment signing as some kind of a multifactor.

      I have my signing key saved on YubiKey, so it’s pretty difficult that an attacker could gain access to it.

      However, you can still commit through git web browser, and usually have a session for it open when working. If I slipped up and someone got to my PC while I have github open (or managed to steal my session cookies somehow - i.e a rubber ducky driveby), his options are:

      • Commit without signing through SSH. I have ssh key password in my password manager that auto-locks after a minute, so that shouldn’t happen, plus the commit wouldn’t be signed since I have the key with me.
      • Commit something though the browser - he can’t sign it.
      • Add SSH or a new signing key through the browser - I get immediately notified.

      So, the end result should be that thanks to the signing mechanism, I should immediately know that something is wrong. Is it neccessary? Probably not, but I still think it’s worth it, at least for me.

      Now I’m wondering whether it wouldn’t be better to have the ssh key on the Yubikey instead. Hmm. I did only discover commit signing later, and didn’t have ybikey before, so it never occured to me.