https://github.com/yuce/pyopenbsd
Python wrapper for some OpenBSD-specific APIs
https://github.com/yuce/pyopenbsd
cffi openbsd pledge python unveil
Last synced: 19 days ago
JSON representation
Python wrapper for some OpenBSD-specific APIs
- Host: GitHub
- URL: https://github.com/yuce/pyopenbsd
- Owner: yuce
- License: bsd-3-clause
- Created: 2019-05-02T23:44:06.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-05T05:54:28.000Z (almost 6 years ago)
- Last Synced: 2025-04-12T06:18:39.901Z (19 days ago)
- Topics: cffi, openbsd, pledge, python, unveil
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# openbsd
Python bindings for some OpenBSD-specific APIs. Currently the following are supported:
* `pledge`
* `unveil`## Change Log
### v0.1.0 (2019-05-03)
* Initial release.
## Installation
Openbsd is on PyPI. You can install it using pip:
pip install openbsd
### Prerequisites
* OpenBSD 6.4 or better
* Python 3.6 or better OR Python 2.7## Usage
Import `openbsd` first:
```python
import openbsd
```### pledge
See: https://man.openbsd.org/pledge.2
```python
openbsd.pledge("stdio rpath")
print(open("/etc/resolv.conf"))
```Try removing the`rpath permission.
### unveil
See: https://man.openbsd.org/unveil.2
```python
openbsd.unveil("/etc", "r")
print(open("/etc/resolv.conf"))
```Try opening `/bin/ksh`.
Use `openbsd.unveil()` to lock down restrictions.
## Similar Projects
* [PyPledge](https://gitlab.com/i80and/pypledge): Python binding for the OpenBSD pledge(2) system call. Uses ctypes.
## License
(c) 2019 Yuce Tekol
[BSD](LICENSE)