Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Executing untrusted scripts in a sandboxed environment

Reply
Thread Tools

Executing untrusted scripts in a sandboxed environment

 
 
Robin Krahl
Guest
Posts: n/a
 
      10-05-2012
Hi all,

I need to execute untrusted scripts in my Python application. To avoid security issues, I want to use a sandboxed environment. This means that the script authors have no access to the file system. They may only access objects, modules and classes that are "flagged" or "approved" for scripting.

I read that I will not be able to do this with Python scripts. (See SandboxedPython page in the Python wiki [0] and several SE.com questions, e. g. [1].) So my question is: What is the best way to "embed" a script engine in a sandboxed environment that has access to the Python modules and classes that I provide?

Thanks for your help.

Best regards,
Robin

[0] http://wiki.python.org/moin/SandboxedPython
[1] http://stackoverflow.com/questions/3...in-pure-python
 
Reply With Quote
 
 
 
 
Ramchandra Apte
Guest
Posts: n/a
 
      10-06-2012
On Saturday, 6 October 2012 04:00:08 UTC+5:30, Robin Krahl wrote:
> Hi all,
>
> I need to execute untrusted scripts in my Python application. To avoid security issues, I want to use a sandboxed environment. This means that the script authors have no access to the file system. They may only access objects, modules and classes that are "flagged" or "approved" for scripting.
>
> I read that I will not be able to do this with Python scripts. (See SandboxedPython page in the Python wiki [0] and several SE.com questions, e. g. [1].) So my question is: What is the best way to "embed" a script engine ina sandboxed environment that has access to the Python modules and classes that I provide?
>
> Thanks for your help.
>
> Best regards,
> Robin
>
> [0] http://wiki.python.org/moin/SandboxedPython
> [1] http://stackoverflow.com/questions/3...in-pure-python

From http://wiki.python.org/moin/SandboxedPython
"The Java and CLR/.NET runtimes support restricted execution, and these canbe utilised through the Jython and IronPython variants of Python (as well as by other languages, obviously)."
You can also check out http://doc.pypy.org/en/latest/sandbox.html for PyPy's sandbox
 
Reply With Quote
 
 
 
 
Ramchandra Apte
Guest
Posts: n/a
 
      10-06-2012
On Saturday, 6 October 2012 04:00:08 UTC+5:30, Robin Krahl wrote:
> Hi all,
>
> I need to execute untrusted scripts in my Python application. To avoid security issues, I want to use a sandboxed environment. This means that the script authors have no access to the file system. They may only access objects, modules and classes that are "flagged" or "approved" for scripting.
>
> I read that I will not be able to do this with Python scripts. (See SandboxedPython page in the Python wiki [0] and several SE.com questions, e. g. [1].) So my question is: What is the best way to "embed" a script engine ina sandboxed environment that has access to the Python modules and classes that I provide?
>
> Thanks for your help.
>
> Best regards,
> Robin
>
> [0] http://wiki.python.org/moin/SandboxedPython
> [1] http://stackoverflow.com/questions/3...in-pure-python
>From http://wiki.python.org/moin/SandboxedPython

"The Java and CLR/.NET runtimes support restricted execution, and these canbe utilised through the Jython and IronPython variants of Python (as well as by other languages, obviously)."
You can also check out http://doc.pypy.org/en/latest/sandbox.html for PyPy's sandbox
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Executing untrusted scripts in a sandboxed environment Rodrick Brown Python 0 10-06-2012 01:25 PM
Re: Executing untrusted scripts in a sandboxed environment Mark Lawrence Python 0 10-06-2012 10:36 AM
Re: Executing untrusted scripts in a sandboxed environment Chris Angelico Python 2 10-06-2012 09:23 AM
Executing js/ajax in a sandboxed environment Rohan Malhotra Python 0 02-27-2011 04:56 AM
Executing untrusted code Emanuele D'Arrigo Python 6 08-20-2009 09:46 PM



Advertisments