commit | 7a5cf6988316c63142409b72bf1fbe99dd668409 | [log] [tgz] |
---|---|---|
author | robertswiecki <robert@swiecki.net> | Sun Nov 25 23:12:23 2018 +0100 |
committer | GitHub <noreply@github.com> | Sun Nov 25 23:12:23 2018 +0100 |
tree | c2bdd653e139356d16c1f0a72677b5de4afdf5af | |
parent | 069a3e96cc09aa50b4e859c937454c801e245ec1 [diff] | |
parent | ec0d4174f1b6cc5a8185e68b4ce0dcbda29a85a8 [diff] |
Merge pull request #99 from rutsky/writeToFd_return_type fix writeToFD() return type in declaration
This is NOT an official Google product.
NsJail is a process isolation tool for Linux. It utilizes Linux namespace subsystem, resource limits, and the seccomp-bpf syscall filters of the Linux kernel.
It can help you with (among other things):
Features:
/proc
and tmpfs
mount pointsPS: You‘ll need to have a valid file-system tree in /chroot
. If you don’t have it, change /chroot
to /
PS: You‘ll need to have a valid file-system tree in /chroot
. If you don’t have it, change /chroot
to /
PS: You‘ll need to have a valid file-system tree in /chroot
. If you don’t have it, change /chroot
to /
PS: You‘ll need to have a valid file-system tree in /chroot
. If you don’t have it, change /chroot
to /
You will also find all examples in the configs directory.
config.proto contains ProtoBuf schema for nsjail's configuration format.
You can examine an example config file in configs/bash-with-fake-geteuid.cfg.
Usage:
You can also override certain options with command-line options. Here, the executed binary (/bin/bash) is overriden with /usr/bin/id, yet options from configs/bash-with-fake-geteuid.cfg still apply
You might also want to try using configs/home-documents-with-xorg-no-net.cfg.
The configs/firefox-with-net.cfg config file will allow you to run firefox inside a sandboxed environment:
A more complex setup, which utilizes virtualized (cloned) Ethernet interfaces (to separate it from the main network namespace), can be found in configs/firefox-with-cloned-net.cfg. Remember to change relevant UIDs and Ethernet interface names before use.
As using cloned Ethernet interfaces (MACVTAP) required root privileges, you'll have to run it under sudo:
The command-line options should be self-explanatory, while the proto-buf config options are described in config.proto
To launch nsjail in a docker container clone the repository and build the docker image:
This will build up an image containing njsail and kafel.
From now you can either use it in another Dockerfile (FROM nsjailcontainer
) or directly: