4 releases (2 breaking)

0.3.1 Mar 26, 2024
0.3.0 Oct 10, 2023
0.2.0 Jan 30, 2023
0.1.0 Apr 14, 2021

#61 in Unix APIs

Download history 22271/week @ 2024-01-27 21108/week @ 2024-02-03 22787/week @ 2024-02-10 30888/week @ 2024-02-17 27822/week @ 2024-02-24 22262/week @ 2024-03-02 24383/week @ 2024-03-09 24278/week @ 2024-03-16 23849/week @ 2024-03-23 35539/week @ 2024-03-30 35394/week @ 2024-04-06 28792/week @ 2024-04-13 26761/week @ 2024-04-20 19416/week @ 2024-04-27 19391/week @ 2024-05-04 20325/week @ 2024-05-11

91,126 downloads per month
Used in 14 crates (4 directly)



Rust Landlock library

Landlock is a security feature available since Linux 5.13. The goal is to enable to restrict ambient rights (e.g., global filesystem access) for a set of processes by creating safe security sandboxes as new security layers in addition to the existing system-wide access-controls. This kind of sandbox is expected to help mitigate the security impact of bugs, unexpected or malicious behaviors in applications. Landlock empowers any process, including unprivileged ones, to securely restrict themselves. More information about Landlock can be found in the official website.

This Rust crate provides a safe abstraction for the Landlock system calls along with some helpers.

Use cases

This crate is especially useful to protect users' data by sandboxing:

  • trusted applications dealing with potentially malicious data (e.g., complex file format, network request) that could exploit security vulnerabilities;
  • sandbox managers, container runtimes or shells launching untrusted applications.


A simple example can be found with the path_beneath_rules() helper. More complex examples can be found with the Ruleset documentation and the sandboxer example.

Crate documentation



~21K SLoC