sandbox

Evaluate math equations from unsafe user input in Python

Evaluate math equations from unsafe user input in Python Question: I have a website where the user enters math equations (expressions) and then those equations are evaluated against data (constants) provided by the website. The math operations needed include symbols, arithmetic operations, min(), max() and some other basic functions. A sample equation could be: max(a …

Total answers: 2

Python: block network connections for testing purposes?

Python: block network connections for testing purposes? Question: I’m trying to test a package that provides interfaces to a few web services. It has a test suite that is supposed to test most functions without connecting to the internet. However, there are some lingering tests that may attempt to connect to the internet / download …

Total answers: 6

Run python script with reduced permissions

Run python script with reduced permissions Question: I have to run some student-made code that they made as homework, I’m running this on my own computer (Mac OS), and I’m not entirely certain they won’t accidentally “rm -rf /” my machine. Is there an easy way to run their python scripts with reduced permissions, so …

Total answers: 3

Sandboxing in Linux

Sandboxing in Linux Question: I want to create a Web app which would allow the user to upload some C code, and see the results of its execution (the code would be compiled on the server). The users are untrusted, which obviously has some huge security implications. So I need to create some kind of …

Total answers: 13