Skip to content

A wrapper crate around rust-landlock that provides useful abstractions and utilities

License

Notifications You must be signed in to change notification settings

basalt-rs/leucite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leucite

Crates.io Documentation Dependency status

A wrapper crate around rust-landlock that provides useful abstractions and utilities

Example

let rules = Rules::new()
    .add_read_only("/usr")
    .add_read_only("/etc")
    .add_read_only("/dev")
    .add_read_only("/bin")
    .add_read_write("/tmp/foo");

// Execute `bash -i` in the `/tmp/foo` directory using the provided rules
Command::new("bash")
    .arg("-i")
    .current_dir("/tmp/foo")
    .env_clear()
    .restrict(rules.into())
    .max_memory(MemorySize::from_mb(100))
    .spawn()?
    .wait()?;

About

A wrapper crate around rust-landlock that provides useful abstractions and utilities

Resources

License

Stars

Watchers

Forks