Skip to main content

Module sandbox

Module sandbox 

Source
Expand description

Defense-in-depth host sandboxing (Linux Landlock ABI v1-v4 + PR_SET_NO_NEW_PRIVS) and cross-platform host process telemetry (getrusage peak RSS, getrandom entropy).

Structs§

SandboxPathGrant
Host path allowed through Landlock when sandboxing is enabled.
SandboxStatus
Summary of the OS sandbox enforcement status.

Functions§

apply_landlock
Apply Linux Landlock + PR_SET_NO_NEW_PRIVS to the current thread and all threads it subsequently spawns.
fill_random
Fill dst with cryptographic entropy via syscall (getrandom on Linux) so no /dev/urandom filesystem access is required after Landlock is applied.
init_rss_handle
Pre-open /proc/self/status before applying Landlock so peak_rss_mib() can continue reading VmHWM: without opening any paths afterward.
peak_rss_mib
Read peak resident set size (MiB) accurately: