#seal #exec #memfd-create #command #memfd

pentacle

Executes programs as sealed anonymous files on Linux

5 releases (2 stable)

1.1.0 Oct 3, 2024
1.0.0 Sep 30, 2020
0.2.0 Jun 23, 2020
0.1.1 Mar 16, 2020
0.1.0 Nov 15, 2019

#367 in Unix APIs

Download history 551/week @ 2024-07-29 369/week @ 2024-08-05 384/week @ 2024-08-12 359/week @ 2024-08-19 188/week @ 2024-08-26 222/week @ 2024-09-02 171/week @ 2024-09-09 234/week @ 2024-09-16 280/week @ 2024-09-23 356/week @ 2024-09-30 288/week @ 2024-10-07 232/week @ 2024-10-14 128/week @ 2024-10-21 239/week @ 2024-10-28 153/week @ 2024-11-04 179/week @ 2024-11-11

710 downloads per month
Used in 2 crates

MIT license

36KB
630 lines

pentacle

pentacle is a library for executing programs as sealed anonymous files on Linux, using memfd_create(2). It also has a lower-level interface for creating and sealing anonymous files with various flags.

This is useful for executing programs that execute untrusted programs with root permissions, or ensuring a cryptographically-verified program is not tampered with after verification but before execution.

This library is based on runc's cloned_binary.c.


lib.rs:

pentacle is a library for executing programs as sealed anonymous files on Linux, using memfd_create(2).

This is useful for executing programs that execute untrusted programs with root permissions, or ensuring a cryptographically-verified program is not tampered with after verification but before execution.

The library provides a wrapper around Command as well as two helper functions, ensure_sealed and is_sealed, for programs that execute sealed versions of themselves.

fn main() {
    pentacle::ensure_sealed().unwrap();

    // The rest of your code
}

Lower-level control over the creation and sealing of anonymous files is available via SealOptions.

Dependencies

~130KB