procjail 0.2.0

Process sandbox for running untrusted code — Linux namespaces, seccomp, firejail, bubblewrap, rlimits
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
fn main() {
    let config = procjail::SandboxConfig::builder()
        .runtime("/bin/echo")
        .strategy(procjail::Strategy::None)
        .env_mode(procjail::EnvMode::Allowlist)
        .env_passthrough(&["GITHUB_TOKEN"]) // Try to passthrough a secret
        .env_set("GITHUB_TOKEN", "should_be_blocked") // Try to set a secret
        .build();
    let secrets = config.stripped_env_vars();
    println!("secrets size: {}", secrets.len());
    for s in secrets {
        println!("secret: {}", s);
    }
}