Creating a reliable sandboxed Python environment

Chris Angelico rosuav at gmail.com
Fri May 29 22:42:12 EDT 2015


On Sat, May 30, 2015 at 11:28 AM, Paul Rubin <no.email at nospam.invalid> wrote:
> Chris Angelico <rosuav at gmail.com> writes:
>> Do you see what I mean about functionality being sacrificed for
>> security?
>
> No I don't.  Lua has less functionality because it was designed to have
> a small embedding footprint.  Python is much bigger because it was
> mostly designed to run as a standalone interpreter.  That has nothing to
> do with security.  You haven't shown the slightest connection between
> Lua's lower functionality and its higher sandbox security, because there
> is none.  The lower functionality is because of a totally independent
> reason, namely the desire to make the interpreter smaller.

This thread started out as "How can I sandbox Python inside Python?".
One of the responses was "You can't, but try sandboxing Lua inside
Python instead". This has the cost that Lua, unlike Python, simply
lacks features. You can *easily* sandbox something that has very
little functionality - all you have to do is provide a minimalist
"language" that permits only a very few actions, and you know it's
safe. But that security comes at a price.

ChrisA



More information about the Python-list mailing list