93 points · by Bender · 6y ago · 42 comments
I feel that the benefits in outsourcing some of that risk management could be a service worth paying for, at least for commercial purposes. It might lag behind and given the number of NPM packages most likely wouldn't offer the full range of packages, but I could see it bringing peace of mind for like the 90% of use-cases.
At the moment it would appear every NPM user is responsible for their own security, and the barrier of entry to the NPM repository is low which is fine and in keeping with the general principles of open source and distributed development, but on the flipside wouldn't it be more efficient to centralise the security auditing and management effort somewhere?
I don't know, just thinking out loud, perhaps there's good reasons why this hasn't happened.
Here's the previous HN discussion [2].
[0] https://github.com/crev-dev/crev/
But it looks like crev deals with this by allowing users to choose their circle of trust, which is an interesting concept, definitely following this project and will take a deeper dive into it. Cheers :)
From the user's POV, opting to use the certified package repo would be a conscious decision and the trade-offs vs benefits should be well advertised. The service could also offer a "self certified" package facility to users if they understand the risks.
Now that I think about the potential downsides, would developers eschew dependencies to reduce the risk of losing a coveted "certified" badge, thereby undermining one of the more useful aspects of nodejs? Would developers get upset their code is included in a paid service and demand takedown or a revenue share? Fast forward a bunch of years, does this certification service become a looming spectre hovering over the node ecosystem and end up hurting what it was supposed to protect? Is the risk of a zero-day making it into the "official" repository too big for a startup to handle? Is it too much to ask users to simply "trust the process"? Would it just be too annoying for in-house developers to constantly have to battle missing and outdated dependencies as the certification team struggles to keep up with the constant stream of updates and new packages?
It would definitely require a lot of resources to set up and maintain, not to mention financial and legal finesse.
Maybe this is why I haven't come across such a service yet, maybe it's just in the too-hard basket or something. Interesting to think about though.
This is where I think this argument breaks down. The average person can follow directions well enough to copy/paste something in the terminal without understanding what it means or what they risk by doing so. Platforms like Apple's rely on the vectors for compromise being minimized to the average user.
That being said, NPM is obviously aimed at developers so that's less of an issue. I support this type of thing for developer tools because there's a barrier of entry. I don't support it for things like App Stores because I've dealt with people enough to know that they will do things without understanding the repercussions and I have a hard time blaming them for not completely understanding such a complex issue/topic.
https://tac.bitnami.com/This exists and is not uncommon in the enterprise world. sonatype is an example I have worked with in my Java days and I think they over npm too nowadays. It's just expensive and therefore not ubiquitous.
Maybe this could be a community effort.
It’s probably worth mentioning that this doesn’t sound like the back door was successful at all. Every package typically has around ~100-200 downloads immediately due to scanners and proxies.
This security response of under a day really sounds like a good improvement, although I still wish npm had some support for signatures so trusted packages can be trusted indefinitely.
If you specify an exact package version, you can trust that to be immutable. NPM doesn't allow replacing of existing versions, only addition of new versions.
npm config set ignore-scripts true
yarn config set ignore-scripts true
https://blog.npmjs.org/post/141702881055/package-install-scr...Was I just doing this wrong?
Anyway, this is what you could do. Find out which packages require postinstall scripts and then run it manually:
$ grep postinstall node_modules/**/package.json
node_modules/node-sass/package.json: "postinstall": "node scripts/build.js",
$ cd node_modules/node-sass/
$ yarn run postinstall
On the positive side, you get to know more about the dependency that you are trying to add :)if problem, evaluate if you need to install that component and if look at the script.
One very real benefit that separation gives you is that if you consciously run your email and banking outside of the VM, you now have a VM barrier between those things, meaning the malware now can _only_ steal ssh keys and docker logins and such, not those and your email + banking account password.
But really, why stop at just one VM? Why not use Qubes [0] and put your email webbrowser in a different VM from your banking webbrowser, your nodejs development in a different vm from your ruby development?
Currently using an ansible/cloud-init approach to spin up VMs on a proxmox server and vscode ssh remote dev in, but I guess it's a case of many ways to skin a cat.
SSH keys...yeah was trying to implement a jump server with 2FA but didn't get anywhere with it. VS code ssh remote doesn't seem to like jump servers even without 2FA.
Early days though...
Clipboards are one of the several security knobs it's hard to get just right when adding layers of security to desktop apps. Qubes does this by having separate clipboards, and requiring specific global hotkeys to move clipboard contents between specific containers [0].
A- Trust the source or an auditing third party (source signatures, apt, App Store, etc)
B- Run it on a sandbox, optionally extended with capabilities explicitly allowed by the user (browser, android, docker, wasm, snap, etc)
It seems there is no other way. This also shows how the classic unix permission model is obsolete. I think Wasm has a big role to play here.
Full disclosure: I'm the author of said application.
things like disk + network aren't necessary for a lot of libs
you should need to declare a manifest thing to access the platform APIs for those resources
I'm concluding that only by this very old thread; I'm not up-to-date with deno + could be wrong