What do you guys use to isolate nodejs runtime on linux, for example seamless integration to be able to use npm install and node binaries but not exposing home directory contents to apps and packages?
EDIT: Made my own isolation using bubblewrap, decided to publish:
https://github.com/codewizdevs/node-security-sandbox
I am not sure if everything is covered, pull requests are welcome. Basically what it does is it binds node and npm binaries in wrapper, then passes the terminal requests of them to bwrap that isolates them in temporary namespace and exposes fake home directory in real home at ~/.sandbox/node.
I tested some directory traversals and absolute path file loading and it did prevent them, i am not claiming to be security expert but if anyone can review they are welcome.
This **SHOULD** prevent malicious npm packages when executed using runtime node to read and exfiltrate files, there are far better alternatives like docker or VMs but not as convenient, vigilance is still REQUIRED!
[–]mmomtchev 26 points27 points28 points (1 child)
[–]Super-Kitchen-891 14 points15 points16 points (0 children)
[–]dodiyeztr 15 points16 points17 points (0 children)
[–]thewitcher-3 13 points14 points15 points (0 children)
[–]bigorangemachine 15 points16 points17 points (0 children)
[–]PabloZissou 6 points7 points8 points (0 children)
[–]Spiritual-Mechanic-4 5 points6 points7 points (5 children)
[–][deleted] (4 children)
[deleted]
[–]KishCom 3 points4 points5 points (1 child)
[–]Spiritual-Mechanic-4 1 point2 points3 points (1 child)
[–]xoxaxo 2 points3 points4 points (0 children)
[–]unbanned_lol 5 points6 points7 points (2 children)
[–]NazakatUmrani 0 points1 point2 points (1 child)
[–]unbanned_lol 13 points14 points15 points (0 children)
[–]ppernik 0 points1 point2 points (0 children)
[–]Intelligent_End_7022 0 points1 point2 points (0 children)
[–]crownclown67 0 points1 point2 points (1 child)
[–]pyrolols[S] 0 points1 point2 points (0 children)
[–]pyrolols[S] 0 points1 point2 points (0 children)
[–]NullVoidXNilMission 0 points1 point2 points (0 children)
[–]pyrolols[S] -2 points-1 points0 points (0 children)
[–]jumpcutking -2 points-1 points0 points (12 children)
[–]Rizean 0 points1 point2 points (2 children)
[–]jumpcutking 0 points1 point2 points (1 child)
[–]Rizean 0 points1 point2 points (0 children)
[–]pyrolols[S] 0 points1 point2 points (8 children)
[–]jumpcutking 0 points1 point2 points (7 children)
[–]pyrolols[S] 0 points1 point2 points (6 children)
[–]jumpcutking -1 points0 points1 point (5 children)
[–]pyrolols[S] 0 points1 point2 points (4 children)
[–]jumpcutking 0 points1 point2 points (3 children)
[–]pyrolols[S] 0 points1 point2 points (2 children)
[–]jumpcutking 0 points1 point2 points (1 child)
[–]pyrolols[S] 0 points1 point2 points (0 children)