RestrictedPython on Google AppEngine (GAE)
I'm looking for a way to execute user submitted python code in GAE in a secure fas开发者_开发百科hion (much stricter then the GAE sandbox).
RestrictedPython would certainly fit the shoe, being used in Zope for the exakt same purpose.
But RestrictedPython relies on modifying the AST (abstract syntax tree) which means loading modules from the compiler (I get as far as loading the parser module before the SDK complains).
Has anyone else done any work with this for Google App Engine?
Note that even if you could get access to the ast modules on GAE, RestrictedPython might still not be the right solution for your use-case. It's only aimed at securing input from less trusted users, where you don't trust their ability to code. You still need to trust and know them.
There's various ways in which a malicious user can cause large resource usage or infinite recursions - so don't use it to protect against anonymous users.
精彩评论