Overview
------------
I'm looking to run a website similar to [login to view URL] in which a user can upload code in a variety of languages. That code is then run on the server and the output is displayed to the user. What I want from you is a backend which enables me to run the code the users upload on my server with no security risks. Note - it is NOT the site I want creating, just the backend on which I can run the code.
Sandbox
------------
Running unchecked code on the server is, of course, a risky operation. So what I want from you is some kind of sandbox or framework through which I can run the uploaded code without risk of something untoward happening. I am running Apache2/Ubuntu on a VPS. I don't want to check the code before running it, it must monitor the program as it is running. The reason for this is that I want to easily be able to extend the site to accept more languages. So this "sandbox" system should work for all programs.
What I want to block
------------
I want to block almost everything. The program should be able to read from stdin and write to stdout or stderr, but not read from or write to files. I want to ensure the program doesn't use many resources, and I also want a cap on the execution time. This can be discussed for further clarification on awarding the project.
Languages
------------
My final goal is to allow a very wide variety of languages, but since this project concerns only the sandbox, I would like to test the system with just one language. I don't mind which language you wish to test with - be it C, Python, PHP, Perl ... whatever you want it can all be installed on my server. :)
Because my goal is to accept any language, it is important that the code remains unchecked, otherwise I would have to create a parser for every language checking for unwanted behaviour. Once the sandbox is created, I expect it to work for all languages.
As for any sentinel programs which monitor the code that is being run, you can, again, use whatever you like.
Possible solutions
------------
I understand that ways of accomplishing this include: Running the code through ptrace and blocking undesirable system calls, running the code through a virtual machine and running the code under a chroot which doesn't allow access to any sensitive files/folders.
Project details
------------
I would like to ensure the sandbox you create works by creating some malicious scripts myself and running them through it. If it successfully blocks my attempts then you win!
Thanks
------------
Thank you for reading this far, I look forward to reading your proposals and to working with one of you!