package restricted

All checked builds pass
  1. Overview
  2. Docs
Limit which system operations and which parts of the filesystem your program can access

Install

dune-project
 Dependency

Authors

Maintainers

Sources

ocaml-restricted-2.0.0.tar.gz
md5=6547cefcfc520d4fe31e1f254e53459b
sha512=3b48e8a135dd1b72549245e986ee7b03330a7eb97ca42e6acbb23dc8ef2319287e41953ee84954aa431530a8e8508a45596838e7dfa676c1859b5a131932dbdc

Description

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

Tags

openbsd restricted

Added to opam-repository:

README

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

  • https://codeberg.org/semarie/ocaml-openbsd
  • https://www.openbsd.org/

Thanks.

LICENSE

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

Dependencies (3)

  1. ppx_inline_test
  2. ocaml >= "5.1.0"
  3. dune >= "3.17"

Dev Dependencies (1)

  1. odoc with-doc

Optional Dependencies

None

Used by

None

Conflicts

None

Build status

Results of building restricted with each compiler on check.ci.ocaml.org, run of against opam-repository 8d8d144. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
2.0.0 (this version) n/a n/a good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure