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.
If you plan to use Lua, take a look at this page on the Lua-users wiki:
Sandboxes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With