I am writing a Node application that allows users to execute arbitrary javascript code - a kind of "internal API" / business stream that goes beyond the normal user interface.
I am looking for a sandbox environment that offers the following:
Separate execution without creating a completely new thread - this will be performed by thousands of users, I would prefer to stick to anonymous functions that do not have access to the parent call stack ... OR ... in the threads event ... the possibility of appearing on multiple servers.
Syntax checking that throws exceptions for parse / exec errors and the entire application crashes.
Ability to disable access to / var functions. I am trying to deny access to Node I / O ... so the user cannot turn this into a DoS script or read / etc / passwd, but can run any native syntax and list of pre-approved functions.
Timeout control ... so the execution ceiling can be applied to while(true) do_intensive_stuff();etc.
Any obvious spring options for the mind?
source
share