# PyExtraSafe
[](https://github.com/Kijewski/pyextrasafe/actions/workflows/ci.yml)
[](https://pyextrasafe.readthedocs.io/)
[](https://pypi.org/project/pyextrasafe/)
[](https://www.python.org/)
[](https://www.kernel.org/)
[](https://github.com/Kijewski/pyextrasafe/blob/main/LICENSE.md)
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](https://docs.rs/extrasafe/0.1.2/extrasafe/index.html).
### Quick Example
```python
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")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Kijewski/pyextrasafe",
"name": "pyextrasafe",
"maintainer": "",
"docs_url": null,
"requires_python": "<4,>=3.8",
"maintainer_email": "",
"keywords": "",
"author": "Ren\u00e9 Kijewski",
"author_email": "pypi.org@k6i.de",
"download_url": "https://files.pythonhosted.org/packages/a6/80/9ea22604a851db8e6b629b9fd02193584b370aa13975b26f8fc6166cdf67/pyextrasafe-0.0.0a1.tar.gz",
"platform": null,
"description": "# PyExtraSafe\n\n[](https://github.com/Kijewski/pyextrasafe/actions/workflows/ci.yml)\n[](https://pyextrasafe.readthedocs.io/)\n[](https://pypi.org/project/pyextrasafe/)\n[](https://www.python.org/)\n[](https://www.kernel.org/)\n[](https://github.com/Kijewski/pyextrasafe/blob/main/LICENSE.md)\n\nPyExtraSafe is a library that makes it easy to improve your program\u2019s security by selectively\nallowing the syscalls it can perform via the Linux kernel\u2019s seccomp facilities.\n\nThe python library is a shallow wrapper around [extrasafe](https://docs.rs/extrasafe/0.1.2/extrasafe/index.html).\n\n### Quick Example\n\n```python\nfrom threading import Thread\nimport pyextrasafe\n\ntry:\n thread = Thread(target=print, args=[\"Hello, world!\"])\n thread.start()\n thread.join()\nexcept Exception:\n print(\"Could not run Thread (should have been able!)\")\n\npyextrasafe.SafetyContext().enable(\n pyextrasafe.BasicCapabilities(),\n pyextrasafe.SystemIO().allow_stdout().allow_stderr(),\n).apply_to_all_threads()\n\ntry:\n thread = Thread(target=print, args=[\"Hello, world!\"])\n thread.start()\n thread.join()\nexcept Exception:\n print(\"Could not run Thread (that's good!)\")\nelse:\n raise Exception(\"Should not have been able to run thread\")\n```\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Make your code extrasafe by preventing it from calling unneeded syscalls",
"version": "0.0.0a1",
"project_urls": {
"Changelog": "https://github.com/Kijewski/pyextrasafe/blob/main/CHANGELOG.md",
"Code": "https://github.com/Kijewski/pyextrasafe",
"Documentation": "https://pyextrasafe.readthedocs.io/",
"Download": "https://pypi.org/project/pyextrasafe/",
"Homepage": "https://github.com/Kijewski/pyextrasafe",
"Tracker": "https://github.com/Kijewski/pyextrasafe/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ba61af52752736b721ce6b54c7cb2ad1e81fac6c0c45583595e3b919cd53aec6",
"md5": "f4c9d022fcd7071cd37bec7c58301667",
"sha256": "228e00a6fd241f517a29893652848d0e0aec2524320bbaa53aaee7aabb007d80"
},
"downloads": -1,
"filename": "pyextrasafe-0.0.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "f4c9d022fcd7071cd37bec7c58301667",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "<4,>=3.8",
"size": 324536,
"upload_time": "2023-05-23T19:39:52",
"upload_time_iso_8601": "2023-05-23T19:39:52.970407Z",
"url": "https://files.pythonhosted.org/packages/ba/61/af52752736b721ce6b54c7cb2ad1e81fac6c0c45583595e3b919cd53aec6/pyextrasafe-0.0.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ef27f48ab19ca4fa1e7f976ae1961380a39f80a686740bd47c76ecef86d03e80",
"md5": "43e7359ed9d641b4f5a7bc112516a126",
"sha256": "69427468beae1629db0a090a4e2f9c2c62950c65b24de7ad5a1247b512f7e815"
},
"downloads": -1,
"filename": "pyextrasafe-0.0.0a1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "43e7359ed9d641b4f5a7bc112516a126",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": "<4,>=3.8",
"size": 324531,
"upload_time": "2023-05-23T19:39:55",
"upload_time_iso_8601": "2023-05-23T19:39:55.125241Z",
"url": "https://files.pythonhosted.org/packages/ef/27/f48ab19ca4fa1e7f976ae1961380a39f80a686740bd47c76ecef86d03e80/pyextrasafe-0.0.0a1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "41e6d922c83e5b674f16d05b34e781ac4af94b7c16cb801839c3182bd6d00261",
"md5": "5bf2c49b7d68651e1adf621b115ae55f",
"sha256": "013af9457c700d93ba2e6ff89931558b6d98756b4285ecb6854d3d0189a1526e"
},
"downloads": -1,
"filename": "pyextrasafe-0.0.0a1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "5bf2c49b7d68651e1adf621b115ae55f",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": "<4,>=3.8",
"size": 324325,
"upload_time": "2023-05-23T19:39:57",
"upload_time_iso_8601": "2023-05-23T19:39:57.852228Z",
"url": "https://files.pythonhosted.org/packages/41/e6/d922c83e5b674f16d05b34e781ac4af94b7c16cb801839c3182bd6d00261/pyextrasafe-0.0.0a1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ab77efb1803ae21e3066117f04a8fec8ee0f5f878c79c0b4788190db9e7a96cc",
"md5": "b5e5038665e7296d4f47fbd30c02fbe4",
"sha256": "95321514cc42748e4eaa6d568ddcc856842d7bacb44e8c641ad6dece0ffbc0cf"
},
"downloads": -1,
"filename": "pyextrasafe-0.0.0a1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "b5e5038665e7296d4f47fbd30c02fbe4",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": "<4,>=3.8",
"size": 324372,
"upload_time": "2023-05-23T19:40:00",
"upload_time_iso_8601": "2023-05-23T19:40:00.950129Z",
"url": "https://files.pythonhosted.org/packages/ab/77/efb1803ae21e3066117f04a8fec8ee0f5f878c79c0b4788190db9e7a96cc/pyextrasafe-0.0.0a1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "75a42346f924dabc7f89ca5d04785eb1563155184aacacf9e1e114b77169a7ea",
"md5": "7fef2ed1c6615935b2a8d77579f01cc6",
"sha256": "07a00ce9b49178faf56820acae1225f2676edc29ec1ce46aac593fff1945ccda"
},
"downloads": -1,
"filename": "pyextrasafe-0.0.0a1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "7fef2ed1c6615935b2a8d77579f01cc6",
"packagetype": "bdist_wheel",
"python_version": "pp38",
"requires_python": "<4,>=3.8",
"size": 325117,
"upload_time": "2023-05-23T19:40:04",
"upload_time_iso_8601": "2023-05-23T19:40:04.867695Z",
"url": "https://files.pythonhosted.org/packages/75/a4/2346f924dabc7f89ca5d04785eb1563155184aacacf9e1e114b77169a7ea/pyextrasafe-0.0.0a1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "feccf6f07e0eaa4a8cc1eab73946b575933b2dd448878298226f18900b09cb5f",
"md5": "b4e09696b67f0de16497a655ce270b11",
"sha256": "4aacc1e9284c54e6297cc79e0dc9f5566037cf85191e51c5c50037e4575c11f8"
},
"downloads": -1,
"filename": "pyextrasafe-0.0.0a1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "b4e09696b67f0de16497a655ce270b11",
"packagetype": "bdist_wheel",
"python_version": "pp39",
"requires_python": "<4,>=3.8",
"size": 324676,
"upload_time": "2023-05-23T19:40:07",
"upload_time_iso_8601": "2023-05-23T19:40:07.705169Z",
"url": "https://files.pythonhosted.org/packages/fe/cc/f6f07e0eaa4a8cc1eab73946b575933b2dd448878298226f18900b09cb5f/pyextrasafe-0.0.0a1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a6809ea22604a851db8e6b629b9fd02193584b370aa13975b26f8fc6166cdf67",
"md5": "a0beb97c57e29f85e467fc176640299a",
"sha256": "d2c32590bd414a576145814ea8efc67f25453adf8c6adb8e65a53896ccde6db1"
},
"downloads": -1,
"filename": "pyextrasafe-0.0.0a1.tar.gz",
"has_sig": false,
"md5_digest": "a0beb97c57e29f85e467fc176640299a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.8",
"size": 18916,
"upload_time": "2023-05-23T19:40:10",
"upload_time_iso_8601": "2023-05-23T19:40:10.775937Z",
"url": "https://files.pythonhosted.org/packages/a6/80/9ea22604a851db8e6b629b9fd02193584b370aa13975b26f8fc6166cdf67/pyextrasafe-0.0.0a1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-23 19:40:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Kijewski",
"github_project": "pyextrasafe",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyextrasafe"
}