pyextrasafe 0.1.0a1

Creator: codyrutscher

Last updated:

Add to Cart

Description:

pyextrasafe 0.1.0a1

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

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.