←back to thread

1208 points jamesberthoty | 1 comments | | HN request time: 0.204s | 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. freakynit ◴[] No.45263796[source]
Wrote a small utility shell script that uses docker behind the scenes to prevent access to your host machine while still allowing full npm install and run workflow.

https://github.com/freakynit/simple-npm-sandbox

Disclaimer: I am not Docker expert. Please review the script (sandbox.js) and raise any potential issues or suggestions.

Thanks..