←back to thread

1208 points jamesberthoty | 1 comments | | HN request time: 0.218s | source
Show context
pingou ◴[] No.45261719[source]
As a developer, is there a way on mac to limit npm file access to the specific project? So that if you install a compromised package it cannot access any data outside of your project directory?
replies(3): >>45261765 #>>45263796 #>>45269698 #
1. tredre3 ◴[] No.45269698[source]
You can run nodejs through `sandbox-exec` which is part of macos.

I've never tried any of them but there's also a few wrappers specifically to do that, such as: https://github.com/berstend/node-safe

Otherwise you're down to docker or virtualisation or creating one system user per project...