[ANN] restricted 2.0.0 limit which system operations and which parts of the filesystem your program can access

Hello,

I am happy to announce a new version of 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 :slight_smile:

CHANGELOG:

  • tested on:
    • x86_64 openbsd (16/16 Tests passed)
    • x86_64-alpine-linux (Landlock ABI version: 7) (4/12 Tests passed: file_read_unv, file_write_unv, file_create_unv_linux, file_cwrr_unv_linux)

Added

  • API: exec promises and accesses optional
  • OpenBSD: exec promises

Removed

  • SystemOperation.TmpPath (deprecated see: pledge (2))
2 Likes