I want my users to write code and run it inside a controlled environment, like for example Lua or Perl. My site runs on Perl CGI's.
Is there a way to run an isolated perl/Lua/python/etc script without access to the filesystem and returns data via stdout to be saved in a database?
What i need is a secure environment, how do i apply the restrictions? Thanks in advance.
FYI: I want to achieve something like ideone.com or codepad.org
I've been reading about sandboxes in Lua or inline code, but they don't allow me to limit resources and time, just operations. I think i'll have a virtual machine and run the code in there, any tips?
One idea that comes to my mind is to create a chroot'ed env for each of your user and run the user's script in that chroot'ed env.
How to run a script that can only write to STDOUT and read from STDIN?