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.
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
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.1.0a1.tar.gz
(26.6 kB
view hashes)
Built Distributions
Close
Hashes for pyextrasafe-0.1.0a1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ebfa727dbc32c4b84be0ea05331c3316cb089a18a4fd49031b47bc2d797aaf5 |
|
MD5 | b88a56d626d7e4b77843c5c132f252cd |
|
BLAKE2b-256 | 7cfc05ff8ef617828d9456346487e0b013807c8817afd4e42695a8fcac65b3e5 |
Close
Hashes for pyextrasafe-0.1.0a1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22ee514f7f2c1ba4215eb9c98feadf3fe5489e98e286119b868f0d3401ad99d1 |
|
MD5 | 0a6e8bca9f809cb0da449c610955d841 |
|
BLAKE2b-256 | fc2a3a095e9dd38771cd998bca9315619d47378c1a2253ef29065f3dd4693bdb |
Close
Hashes for pyextrasafe-0.1.0a1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f3bdc6a0d6ba05dbd4a9aae1728efe7bc081799b7eed00c62dd0b0c771b8031 |
|
MD5 | 4b8a35f03709a3af0afd9ee0a06a1f88 |
|
BLAKE2b-256 | 0ebc4a45dd8cfd990d2d9241472c5ad036fdb1c5b4746fd58596310a83360ebf |
Close
Hashes for pyextrasafe-0.1.0a1-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b957e850786c373b8eef3e474658ec511737acb6f31c0bd6be543d09e093edb |
|
MD5 | d6bdd819f2eaae623b3ca71d2094b5b4 |
|
BLAKE2b-256 | 70b81a5a9d34256c6de6e2b3241166f3488737f3d0b928bfac6e5c825563a973 |
Close
Hashes for pyextrasafe-0.1.0a1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86dfa18269bc1eae6d74efb3acf9344c44456dfc3f61d653af22087778d3c38f |
|
MD5 | 2f12876fe21ee96b685de957a6f10d74 |
|
BLAKE2b-256 | 22edccec05a2df782d69bb187b7ca5f4f1cc5fdc1e41e6ad5b6be58e11bda52d |