2
5
Fork
You've already forked restricted
0
ocaml lib to restrict system operations and filesystem view https://removewingman.codeberg.page/restricted/
  • OCaml 70.3%
  • C 12.6%
  • Shell 11%
  • Makefile 4.6%
  • Dune 1.5%
2026年04月02日 14:55:49 +02:00
.forgejo/workflows Update .forgejo/workflows/publish-doc.yaml 2026年01月17日 15:37:22 +01:00
lib change doc and clean up internal optional messy stuff 2026年03月30日 14:12:44 +02:00
test change opam file 2026年04月02日 14:55:49 +02:00
.gitignore change doc and clean up internal optional messy stuff 2026年03月30日 14:12:44 +02:00
.ocamlformat description and impl changes linux landlock 2026年01月16日 11:48:37 +01:00
CHANGELOG.md small changelog and publish stuff 2026年03月30日 22:00:18 +02:00
dune fix project setup 2026年01月04日 20:14:08 +01:00
dune-project change doc and clean up internal optional messy stuff 2026年03月30日 14:12:44 +02:00
LICENSE init 2026年01月01日 14:32:58 +01:00
Makefile small changelog and publish stuff 2026年03月30日 22:00:18 +02:00
notes.txt change doc and clean up internal optional messy stuff 2026年03月30日 14:12:44 +02:00
README.md run with exec promises 2026年03月14日 22:03:32 +01:00
restricted.opam change opam file 2026年04月02日 14:55:49 +02:00

restricted

This library lets you limit which system operations and which parts of the filesystem your program can access. Call it as early as possible in your program so that the rest of the code runs with reduced privileges. Currently, actual enforced restrictions are implemented for these operating systems:

  • OpenBSD
  • Linux (only filesystem view)

Even on other operating systems, you can still use restricted to document which privileges your program needs. Users can then test if your program respects these promises with tools such as pledge on Linux. Enjoy :)

Usage and Examples

opam install restricted

API Documentation

Contribute

Feel free to open issues and pull requests, especially tests are more than welcome.

Dependencies

  • for build and installation: OCaml, Dune
  • for development: OCaml, Dune, ppx_inline_test, ocamlformat, make, shellcheck, shfmt

inspired by

Thanks.

LICENSE

This work is licensed only under the GNU Affero General Public License version 3 (AGPLv3). See the LICENSE file for details.