Skip to content

Rust implementation of PRoot, a ptrace-based sandbox

License

Notifications You must be signed in to change notification settings

imraghava/proot-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

proot-rs

Rust implementation of PRoot, a ptrace-based sandbox. (Work in progress)

proot-rs works by intercepting all Linux system calls that use paths (execve, mkdir, ls, ...) and translating these with the specified path bindings, in order to simulate chroot, and all this without requiring admin rights (ptrace do not require any special rights).

So for instance, this command:

proot-rs -R /home/user/myfolder mkdir /subfolder

will be equivalent to:

mkdir /home/user/myfolder/subfolder

Hence, you can apply proot-rs to a whole program in order sandbox it. More concretely, you can for instance download a docker image, extract it, and run it, without needing docker:

proot-rs -R ./my-docker-image /bin/sh

Usage

Not usable for now (work in progress).

Requirements

Use the nightly Rust channel for rustc:

cargo default nightly

Some dependencies (like syscall) depend on features (asm in this case) that are not on the stable channel yet.

Build

The recommended way is to use rustup/cargo:

cargo build

It will install all the dependencies and compile it (in debug mode).

To generate the release binary (it takes longer, but the binary generated is quicker):

cargo build --release

Tests

Simply run:

cargo test

About

Rust implementation of PRoot, a ptrace-based sandbox

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 83.9%
  • C 15.5%
  • Assembly 0.6%