Live data from Hacker News

Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem

trigger.dev

11–20 of 191 posts

Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem

#11
post #3

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?

Add a password or hardware 2-factor to your ssh key. And get a password manager with the same for those admin credentials.

Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem

#12
post #7

The 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.

[deleted]

Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem

#14
post #7

The 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.

Malware sometimes suffers from feature creep too.

Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem

#15
post #9

That’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

Yeah, I thought that was the main reason to use pnpm. Very confused.

Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem

#16
post #3

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?

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 put the ssh privkey on the yubikey itself and protect it with a pin.

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

#17
post #8

Earlier 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

Depends on the use case of the repo.

Re: Shai-Hulud compromised a dev machine and raided GitHub org access: a post-mortem

#18
> This incident involved one of our engineers installing a compromised package on their development machine, which led to credential theft and unauthorized access to our GitHub organization.

The 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

#20
post #9

That’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

Maybe the project itself had a postinstall script? It doesn't run lifecycle scripts of dependencies, but it still runs project-level ones.
Post reply on HN