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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyextrasafe-0.1.0a1.tar.gz.
File metadata
- Download URL: pyextrasafe-0.1.0a1.tar.gz
- Upload date:
- Size: 26.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0f6a4705fb09c51736467b83f4531412b7e283ea9bbb33bd5fc652957bae58e
|
|
| MD5 |
5fad12ee3de727ab42001c9b4d6f8a1e
|
|
| BLAKE2b-256 |
70e35366180aea4c383fbe6879bf4f2bb96c625989aa7eb3a2c79db2fc6d9049
|
File details
Details for the file pyextrasafe-0.1.0a1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyextrasafe-0.1.0a1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 307.5 kB
- Tags: PyPy, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ebfa727dbc32c4b84be0ea05331c3316cb089a18a4fd49031b47bc2d797aaf5
|
|
| MD5 |
b88a56d626d7e4b77843c5c132f252cd
|
|
| BLAKE2b-256 |
7cfc05ff8ef617828d9456346487e0b013807c8817afd4e42695a8fcac65b3e5
|
File details
Details for the file pyextrasafe-0.1.0a1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyextrasafe-0.1.0a1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 307.8 kB
- Tags: PyPy, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22ee514f7f2c1ba4215eb9c98feadf3fe5489e98e286119b868f0d3401ad99d1
|
|
| MD5 |
0a6e8bca9f809cb0da449c610955d841
|
|
| BLAKE2b-256 |
fc2a3a095e9dd38771cd998bca9315619d47378c1a2253ef29065f3dd4693bdb
|
File details
Details for the file pyextrasafe-0.1.0a1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyextrasafe-0.1.0a1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 309.2 kB
- Tags: PyPy, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f3bdc6a0d6ba05dbd4a9aae1728efe7bc081799b7eed00c62dd0b0c771b8031
|
|
| MD5 |
4b8a35f03709a3af0afd9ee0a06a1f88
|
|
| BLAKE2b-256 |
0ebc4a45dd8cfd990d2d9241472c5ad036fdb1c5b4746fd58596310a83360ebf
|
File details
Details for the file pyextrasafe-0.1.0a1-cp37-abi3-musllinux_1_1_x86_64.whl.
File metadata
- Download URL: pyextrasafe-0.1.0a1-cp37-abi3-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 338.7 kB
- Tags: CPython 3.7+, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b957e850786c373b8eef3e474658ec511737acb6f31c0bd6be543d09e093edb
|
|
| MD5 |
d6bdd819f2eaae623b3ca71d2094b5b4
|
|
| BLAKE2b-256 |
70b81a5a9d34256c6de6e2b3241166f3488737f3d0b928bfac6e5c825563a973
|
File details
Details for the file pyextrasafe-0.1.0a1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyextrasafe-0.1.0a1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 307.5 kB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86dfa18269bc1eae6d74efb3acf9344c44456dfc3f61d653af22087778d3c38f
|
|
| MD5 |
2f12876fe21ee96b685de957a6f10d74
|
|
| BLAKE2b-256 |
22edccec05a2df782d69bb187b7ca5f4f1cc5fdc1e41e6ad5b6be58e11bda52d
|