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.

Quick Example

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!)")

pyextrasafe.SafetyContext().enable(
    pyextrasafe.BasicCapabilities(),
    pyextrasafe.SystemIO().allow_stdout().allow_stderr(),
).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.0a1.tar.gz (18.9 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.0a1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.7 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

pyextrasafe-0.0.0a1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.1 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

pyextrasafe-0.0.0a1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pyextrasafe-0.0.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pyextrasafe-0.0.0a1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pyextrasafe-0.0.0a1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: pyextrasafe-0.0.0a1.tar.gz
  • Upload date:
  • Size: 18.9 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.0a1.tar.gz
Algorithm Hash digest
SHA256 d2c32590bd414a576145814ea8efc67f25453adf8c6adb8e65a53896ccde6db1
MD5 a0beb97c57e29f85e467fc176640299a
BLAKE2b-256 a6809ea22604a851db8e6b629b9fd02193584b370aa13975b26f8fc6166cdf67

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyextrasafe-0.0.0a1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4aacc1e9284c54e6297cc79e0dc9f5566037cf85191e51c5c50037e4575c11f8
MD5 b4e09696b67f0de16497a655ce270b11
BLAKE2b-256 feccf6f07e0eaa4a8cc1eab73946b575933b2dd448878298226f18900b09cb5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyextrasafe-0.0.0a1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 07a00ce9b49178faf56820acae1225f2676edc29ec1ce46aac593fff1945ccda
MD5 7fef2ed1c6615935b2a8d77579f01cc6
BLAKE2b-256 75a42346f924dabc7f89ca5d04785eb1563155184aacacf9e1e114b77169a7ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyextrasafe-0.0.0a1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 69427468beae1629db0a090a4e2f9c2c62950c65b24de7ad5a1247b512f7e815
MD5 43e7359ed9d641b4f5a7bc112516a126
BLAKE2b-256 ef27f48ab19ca4fa1e7f976ae1961380a39f80a686740bd47c76ecef86d03e80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyextrasafe-0.0.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 228e00a6fd241f517a29893652848d0e0aec2524320bbaa53aaee7aabb007d80
MD5 f4c9d022fcd7071cd37bec7c58301667
BLAKE2b-256 ba61af52752736b721ce6b54c7cb2ad1e81fac6c0c45583595e3b919cd53aec6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyextrasafe-0.0.0a1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 95321514cc42748e4eaa6d568ddcc856842d7bacb44e8c641ad6dece0ffbc0cf
MD5 b5e5038665e7296d4f47fbd30c02fbe4
BLAKE2b-256 ab77efb1803ae21e3066117f04a8fec8ee0f5f878c79c0b4788190db9e7a96cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyextrasafe-0.0.0a1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 013af9457c700d93ba2e6ff89931558b6d98756b4285ecb6854d3d0189a1526e
MD5 5bf2c49b7d68651e1adf621b115ae55f
BLAKE2b-256 41e6d922c83e5b674f16d05b34e781ac4af94b7c16cb801839c3182bd6d00261

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