Make your code extrasafe by preventing it from calling unneeded syscalls
Project description
PyExtraSafe
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
Release history Release notifications | RSS feed
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 hashes)
Built Distributions
Close
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 |
Close
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 |
Close
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 |
Close
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 |
Close
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 |
Close
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 |