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.0.0a1.tar.gz
(18.9 kB
view hashes)
Built Distributions
Close
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 |
Close
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 |
Close
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 |
Close
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 |
Close
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 |
Close
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 |