nsjail/configs/firefox-with-net.cfg

155 lines
2.1 KiB
INI
Raw Normal View History

2017-05-28 03:43:56 +08:00
name: "firefox-with-net"
description: "
This policy allows to run firefox inside a jail. Access to networking is
2017-05-29 21:01:34 +08:00
permitted with this setup (clone_newnet: false).
2017-05-28 03:43:56 +08:00
The only permitted home directory is $HOME/.mozilla and $HOME/Documents.
2017-05-28 09:29:01 +08:00
The rest of available on the FS files/dires are libs and X-related files/dirs.
2017-05-28 03:43:56 +08:00
Run as:
2017-05-28 03:43:56 +08:00
./nsjail --config configs/firefox-with-net.cfg
You can then go to https://uploadfiles.io/ and try to upload a file in order
to see how your local directory (also, all system directories) look like.
2017-05-28 03:43:56 +08:00
"
mode: ONCE
hostname: "FIREFOX"
cwd: "/user"
2017-05-28 03:43:56 +08:00
time_limit: 0
envar: "HOME=/user"
2017-05-28 03:43:56 +08:00
envar: "DISPLAY=:0"
2017-05-28 07:30:26 +08:00
envar: "TMP=/tmp"
2017-05-28 03:43:56 +08:00
rlimit_as: 4096
rlimit_cpu: 1000
rlimit_fsize: 1024
rlimit_nofile: 128
clone_newnet: false
mount {
dst: "/proc"
fstype: "proc"
}
mount {
src: "/lib"
dst: "/lib"
is_bind: true
}
mount {
2017-05-28 08:55:50 +08:00
src: "/usr/lib"
dst: "/usr/lib"
2017-05-28 03:43:56 +08:00
is_bind: true
}
mount {
src: "/lib64"
dst: "/lib64"
is_bind: true
mandatory: false
}
mount {
src: "/lib32"
dst: "/lib32"
is_bind: true
mandatory: false
}
mount {
src: "/usr/lib/firefox"
dst: "/usr/lib/firefox"
is_bind: true
}
mount {
src: "/usr/bin/firefox"
dst: "/usr/bin/firefox"
is_bind: true
}
2017-05-28 08:55:50 +08:00
mount {
src: "/usr/share"
dst: "/usr/share"
is_bind: true
}
2017-05-28 03:43:56 +08:00
mount {
src: "/dev/urandom"
dst: "/dev/urandom"
is_bind: true
2017-05-28 07:24:55 +08:00
rw: true
2017-05-28 03:43:56 +08:00
}
mount {
2017-05-28 09:19:13 +08:00
src: "/etc/resolv.conf"
2017-05-28 03:43:56 +08:00
dst: "/etc/resolv.conf"
is_bind: true
mandatory: false
}
mount {
dst: "/tmp"
fstype: "tmpfs"
2017-05-28 07:24:55 +08:00
rw: true
2017-05-28 03:43:56 +08:00
is_bind: false
}
2017-06-20 09:14:09 +08:00
mount {
dst: "/dev/shm"
fstype: "tmpfs"
rw: true
is_bind: false
}
mount {
dst: "/user"
fstype: "tmpfs"
2017-05-28 07:24:55 +08:00
rw: true
}
2017-05-28 03:43:56 +08:00
mount {
prefix_src_env: "HOME"
src: "/Documents"
dst: "/user/Documents"
2017-05-28 07:24:55 +08:00
rw: true
is_bind: true
mandatory: false
2017-05-28 03:43:56 +08:00
}
mount {
prefix_src_env: "HOME"
src: "/.mozilla"
dst: "/user/.mozilla"
2017-05-28 03:43:56 +08:00
is_bind: true
2017-05-28 07:24:55 +08:00
rw: true
mandatory: false
2017-05-28 03:43:56 +08:00
}
mount {
src: "/tmp/.X11-unix/X0"
dst: "/tmp/.X11-unix/X0"
is_bind: true
}
seccomp_string: "
POLICY example {
KILL {
ptrace,
process_vm_readv,
process_vm_writev
}
}
USE example DEFAULT ALLOW
"
exec_bin {
2017-05-28 08:55:50 +08:00
path: "/usr/lib/firefox/firefox"
2017-05-28 03:43:56 +08:00
}