|
|
|
|
|
by yedidmh
355 days ago
|
|
Anyone have advise or links for how to dynamically run untrusted code in production? Specifically NodeJS. It looks like the isolated-vm package is the go-to, but understandably it prevents things like fetch or being able to import packages. I’m thinking to use docker and have a single base image that exposes an API that will take an arbitrary string, check for and install imports, then eval (eesh) the code, but before going down the road of implementing it myself and going crazy over properly securing the containers I’m thinking that there has got to be some prior art. How are Codesandbox et al doing it? |
|
If you want to learn more about this subject the keyword you’re looking for is “multitenancy”
Docker’s container runtime is not really a safe way to run untrusted code. I don’t recommend relying on it.
Also, why would an isolated vm prevent fetch? You can give your users NAT addresses to let them make outbound network calls. I am putting the finishing touches on a remote IDE that does exactly that.