Skip to main content

A Python module for sandboxing code execution.

Project description

PyJail

PyJail is a Python module designed to provide a secure environment for executing untrusted code. To execute a function without access to your system, call it through PyJail as shown below.

from pyjail import Jail

with Jail() as jail:
    result = jail.execute(untrusted_func, *func_args, **func_kwargs)

The Jail class constructor has the optional parameters path=os.path.join(os.getcwd(), "jail") and clear_before_create=True. The path parameter specifies the directory where the jail will be created (note that this is a transient directory that will be deleted when the Jail object is destroyed) and the clear_before_create parameter specifies whether the jail directory should be cleared before creation (if it already exists).

[!NOTE] You must run your python script as root to create a jail.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyJail-0.1.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyJail-0.1.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file PyJail-0.1.0.tar.gz.

File metadata

  • Download URL: PyJail-0.1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for PyJail-0.1.0.tar.gz
Algorithm Hash digest
SHA256 83dd634cb3c8109e3fbf62b2e574074f299826321c5f6f391978b6f374d1d22c
MD5 769c1ea0d4d74d25fd62b61857da994b
BLAKE2b-256 ac7045b6f8eb51a9ab634a3914ad3064dccc021bef9f546acd691bf3bb399ccc

See more details on using hashes here.

File details

Details for the file PyJail-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: PyJail-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for PyJail-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3cb94d8cfbc8584c3a82d6afab258a17eb1c8dd55869e9d7a5685e969abd05e
MD5 b89218c194917474d8489cb27609f615
BLAKE2b-256 29372d0955b84a12bb6133334a0c0011a9bf4369e7c3bc96aa62ce234a65046e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page