logoalt Hacker News

gajusyesterday at 10:00 PM6 repliesview on HN

Reminder to secure your npm environments.

https://gajus.com/blog/3-pnpm-settings-to-protect-yourself-f...

Just a handful of settings to save a whole lot of trouble.


Replies

jdxcodetoday at 1:47 AM

In aube you get all this out of the box plus a lifecycle jail (next MV will have that on by default) and defaults to trustPolicy=no-downgrade (would not have helped here but still a good default).

It has the strongest security posture of any node pm.

https://aube.en.dev/security.html#jailed-lifecycle-scripts

show 2 replies
arczayesterday at 10:33 PM

Wild claim that setting the minimum age to 7 days will result in me "never" getting a supply chain npm vuln.

show 3 replies
Narretzyesterday at 10:04 PM

Isn't this article wrong about npm minumum release age. 1. The config is min-release-age. 2. For some reason they have chosen to make it days instead of minutes: https://docs.npmjs.com/cli/v11/using-npm/config#min-release-...

Completely unforced fragmentation of the dependency manager space imo

show 1 reply
mebcittotoday at 9:41 AM

Unfortunately there is currently an issue in pnpm that makes `minimumReleaseAge` difficult: https://github.com/pnpm/pnpm/issues/11068

rvzyesterday at 10:06 PM

And absolutely pin, pin, pin, ALL your dependencies.

If I see a package version dependency that looks like this: ^1.0.0 or even this: "*", then stop reading, pin it to a secure version immediately.

show 5 replies