radare2/doc/sandbox
pancake e6f2cd0b2a
Remove trailing spaces (#19460)
$ git grep ' $' | grep -v ^test/ | cut -d : -f 1 | sort -u > /tmp/trailing
$ for a in `cat /tmp/trailing` ; do sed -i -e 's/ *$//' $a ; done
2021-12-02 17:39:59 +01:00
..
Makefile Add doc/sandbox (osx seatbelt and openbsd systrace support) 2015-03-03 01:57:21 +01:00
rabin2.sb Remove trailing spaces (#19460) 2021-12-02 17:39:59 +01:00
radare2.sb Remove trailing spaces (#19460) 2021-12-02 17:39:59 +01:00
README.md updating slighty the sandbox readme (#10357) 2018-06-15 16:26:34 +02:00

Sandboxing r2

radare2 supports sandboxing natively by wrapping all attempts to access the filesystem, network or run programs.

But for some platforms, the kernel provides a native sandboxing experience. ATM only OSX and OpenBSD are supported by r2, feel free to extend the support to Linux and Windows.

OSX

OSX Seatbelt implements a system-level sandbox for applications, the rules are described in a lispy .sb file:

$ sandbox-exec -f radare2.sb r2 -S /bin/ls

NOTE: r2 -S is an alias for -e cfg.sandbox=true

OpenBSD (from 5.9)

OpenBSD comes with support for sandboxing using the pledge(2) syscall.

Only the following are allowed:

  • stdio and tty manipulation
  • filesystem reading
  • mmap(2) PROT_EXEC manipulation

OpenBSD (until 5.9)

OpenBSD comes with support for sandboxing using the systrace utility.

$ man systrace

Generate default profile

$ systrace -A r2 /bin/ls

Run with the generated profile

$ systrace -a r2 -S /bin/ls

FreeBSD (from 10.0)

FreeBSD comes with the Capsicum framework support, using cap_enter(2).

Operations limited on what basic capability mode support.

Other

Only r2's sandbox is supported.

  • disables file system access

  • disables network connectivity

  • disables forks (no shell escapes or debugger)

  • activated before showing the prompt

    $ r2 -S /bin/ls