Skip to main content

Make your code extrasafe by preventing it from calling unneeded syscalls

Project description

PyExtraSafe

GitHub Workflow Status Documentation Status PyPI Python >= 3.8 OS: Linux License

PyExtraSafe is a library that makes it easy to improve your program’s security by selectively allowing the syscalls it can perform via the Linux kernel’s seccomp facilities.

The python library is a shallow wrapper around extrasafe.

from threading import Thread
import pyextrasafe


try:
    thread = Thread(target=print, args=["Hello, world!"])
    thread.start()
    thread.join()
except Exception:
    print("Could not run Thread (should have been able!)")

ctx = pyextrasafe.SafetyContext()
ctx.enable(pyextrasafe.BasicCapabilities())
ctx.enable(pyextrasafe.SystemIO().allow_stdout().allow_stderr())
ctx.apply_to_all_threads()

try:
    thread = Thread(target=print, args=["Hello, world!"])
    thread.start()
    thread.join()
except Exception:
    print("Could not run Thread (that's good!)")
else:
    raise Exception("Should not have been able to run thread")

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

pyextrasafe-0.0.0a0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distributions

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

pyextrasafe-0.0.0a0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (318.3 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

pyextrasafe-0.0.0a0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (318.6 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

pyextrasafe-0.0.0a0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (317.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pyextrasafe-0.0.0a0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (317.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pyextrasafe-0.0.0a0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (317.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pyextrasafe-0.0.0a0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (317.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file pyextrasafe-0.0.0a0.tar.gz.

File metadata

  • Download URL: pyextrasafe-0.0.0a0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pyextrasafe-0.0.0a0.tar.gz
Algorithm Hash digest
SHA256 cf9a0d986d1445e6581b47498b37feb109f6db57e845657e2684c4c0c548eca0
MD5 c9b252e0ca987670f20e90d03938e3a8
BLAKE2b-256 30cf8654efc2fa3e6c470ee21271c4e7a512c2e33f57f27bdd9c49e74baf232b

See more details on using hashes here.

File details

Details for the file pyextrasafe-0.0.0a0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyextrasafe-0.0.0a0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3e3736c2e77574b72b5507b814675c16f3d64d498fe783db88e2faf0ed3f4dd6
MD5 423b78b43a8c378a322cf6831c1a6edb
BLAKE2b-256 88fe13641f1d9c918642a591afe75a9f09fc7d4d7bcaf66bd1199993d1c882b7

See more details on using hashes here.

File details

Details for the file pyextrasafe-0.0.0a0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyextrasafe-0.0.0a0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5eab0f17bacf16ae31a4d3fdbbed19ba64b10e2d21d78cbc7552b4527fb36002
MD5 b505db8fc4d702d759190c5555bd1773
BLAKE2b-256 a9f1a32abf38449d39a8834ae081c09dd3d4ce14cefb21e82393b5cefbace7e5

See more details on using hashes here.

File details

Details for the file pyextrasafe-0.0.0a0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyextrasafe-0.0.0a0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc8ef63bc6d937f04f16756085e64d6fffcdf9e09ca0da9e99776010e7ec0ae4
MD5 8f0ac06d850d9f169c3755b476edc767
BLAKE2b-256 653f72d97776480e78311ace383797158ec3a787b3dbacae49e0efee0f95f998

See more details on using hashes here.

File details

Details for the file pyextrasafe-0.0.0a0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyextrasafe-0.0.0a0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d100c8e9c023e4da3a35c70b172e1d18a943a6729825348cb0e79b3d6332fa47
MD5 196660e4894dc6ee74c900b26d1f2ae5
BLAKE2b-256 813ab109f74ce73ab92965f5f3cda0e78aece81a553ba494ade5dbecb0614856

See more details on using hashes here.

File details

Details for the file pyextrasafe-0.0.0a0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyextrasafe-0.0.0a0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8357f980d0022e21f158c99da8363f8eee2ded10aca12bd81e61b41f6120abee
MD5 7e983470f7a1569c73cfdd763f00e417
BLAKE2b-256 cbfa5346591059d153faa29d1ce207d9e6e8e2ab04d7c7964f4e50ebf0d61ca5

See more details on using hashes here.

File details

Details for the file pyextrasafe-0.0.0a0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyextrasafe-0.0.0a0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 33b9f51e7ad80e25ab70040dcfd3eb4135c5a2e7c737ca9e984ea0b2532b10df
MD5 b9edfb2e8f6f0b380747db3b522e1e1b
BLAKE2b-256 813b4456402762efe07650ba48cb67a3dcb739d1cf21c9bc88461d71a02ef7dc

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