I have been thinking about this. How do I make my git setup on my laptop secure? Currently, I have my ssh key on the laptop, so if I want to push, I just use git push. And I have admin credentials for the org. How do I make it more secure?
Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem
11–20 of 191 posts
Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem
#12The approach the attacker took makes little sense to me, perhaps someone else has an explanation for it? At first they monitored what's going on and then silently exfiltrated credentials and private repos. Makes sense so far. But then why make so much noise with trying to force push repositories? It's Git, surely there's a clone of nearly everything on most dev machines etc.
Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem
#13I am loving the ancient Lovecraftian horror vibe of these exploit names. Good for raising awareness, I guess!
Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem
#14The approach the attacker took makes little sense to me, perhaps someone else has an explanation for it? At first they monitored what's going on and then silently exfiltrated credentials and private repos. Makes sense so far. But then why make so much noise with trying to force push repositories? It's Git, surely there's a clone of nearly everything on most dev machines etc.
Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem
#15That’s weird, pnpm no longer automatically runs lifecycle scripts like preinstall [1], so unless they were running a very old version of pnpm, shouldn’t they have been protected from Shai-Hulud? 1: https://github.com/pnpm/pnpm/pull/8897
Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem
#16I have been thinking about this. How do I make my git setup on my laptop secure? Currently, I have my ssh key on the laptop, so if I want to push, I just use git push. And I have admin credentials for the org. How do I make it more secure?
You can add a gpg key and subkeys to a yubikey and use gpg-agent instead of ssh-agent for ssh auth. When you commit or push, it asks you for a pin for the yubikey to unlock it.
You can also just generate new ssh keys and protect them with a pin.
Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem
#17Earlier quoted context omitted.
You can set up your repo to disable pushing directly to branches like main and require MFA to use the org admin account, so something malicious would need to push to a benign branch and separately be merged into one that deploys come from.
Pushing directly to main seems crazy - for anything that is remotely important I would use a pull request/merge request pattern
Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem
#18The org only has 4-5 engineers. So you can imagine the impact a large org will have.
Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem
#19Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem
#20That’s weird, pnpm no longer automatically runs lifecycle scripts like preinstall [1], so unless they were running a very old version of pnpm, shouldn’t they have been protected from Shai-Hulud? 1: https://github.com/pnpm/pnpm/pull/8897