Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Secure Python intepreter?

Is there a secure Python intepreter?

Imagine a Python VM you can run on your machine, that restricts the operations. No files can be opened, no system calls, etc. It just transforms stdin to stdout, maybe with text processing + math etc.

Does such a secure Python VM exist?

like image 783
Joseph Turian Avatar asked Nov 08 '09 01:11

Joseph Turian


1 Answers

I know of no such "secure interpreter" that is openly distributed (obviously Google has one that it uses in App Engine, though with somewhat different restrictions from those you desire, e.g., certain files can be opened, in a read-only way). There are some claims for it, though, e.g. here, though I can't verify them. Pypy's Python in a Sandbox is probably the top one worth trying, given the high quality and reputation of pypy's development team (they're VERY unlikely to make unsubstantiated claims).

like image 180
Alex Martelli Avatar answered Oct 04 '22 04:10

Alex Martelli