by stephenr · 6mo ago · 0 comments
Just a word of warning from someone who's always advocated for this approach:
Prepare to be inundated with ridiculous, nonsensical arguments about why it's impossible to work that way.
If you blindly copy in changes how is it any different from npm pulling in those same changes, other than being much slower?
- dependencies "disappearing" (aka left pad 2, electric boogaloo)
- dependencies running nefarious "install scripts" on prod
Apparently some language package managers also will silently install newer versions than a lock file specifies, if you use the wrong install command. So that's arguably more a case of saving you from yourself but the example I saw said that "... install" is wrong you need to use "... ci" which is kind of asinine IMO.
Things like sudden changes in dependencies should also be noticed more readily.
If you already had left pad cached then you were not affected by its disappearance.
If a package needs an install script to be used, to compile some native code for example, you still need to run the install script before you can use the package.
Manually repeating the actions npm does automatically does nothing to protect you from supply chain attacks.
The only thing that helps is to review code before you run it. How the code got to your machine before it was run does not matter.
The evidence of course is that when you say "left pad" no one knows what you're referring to because nothing bad ever happened.
> If a package needs an install script to be used, to compile some native code for example, you still need to run the install script before you can use the package.
This already sounds like a giant red fucking flag, but sure whatever, what you're using needs some compile step. You can be in control of what runs when and where. Heck you could even take the fucking maverick solution and compile the shit once out of band and deploy the compiled binary to your production environment. I know that forethought and planning ahead will come as a fucking shock to the NPM using community, but try it some time, it's really kinda good.
> Manually repeating the actions npm does automatically does nothing to protect you from supply chain attacks.
I mean it does, inherently, if you're running those actions locally in an environment without production access...
Oh noes, your compromised module stole your DB credentials, and your SES credentials to spam all your customers..... and just got a bunch of failures or sent messages to no-one because the environment has dummy data and uses a locked down sending configuration for SES.
There is 100% benefit in running that shit in a development environment.
> The only thing that helps is to review code before you run it.
Right, and somehow you think having the code in question literally in your VCS, waiting for a merge like all the other code... that's not apparently helpful.
But hey thanks for proving me right about the unhinged complaints. Stong echoes of "we've tried nothing and we're all out of ideas".