bubblewrap-scripts/profiles/debian/firefox

36 lines
933 B
Bash

#!/usr/bin/env bash
set -euo pipefail
(
exec bwrap \
--ro-bind /usr /usr \
--ro-bind /lib /lib \
--ro-bind /lib64 /lib64 \
--ro-bind /bin /bin \
--ro-bind /sbin /sbin \
--ro-bind /etc /etc \
--ro-bind /tmp/.X11-unix /tmp/.X11-unix \
--bind /run /run \
--proc /proc \
--dev-bind /dev /dev \
--bind ~/.mozilla /home/jail/.mozilla \
--bind ~/.cache/mozilla /home/jail/.cache/mozilla \
--bind ~/.cache/fontconfig /home/jail/.cache/fontconfig \
--bind ~/.config/ibus /home/jail/.config/ibus \
--bind ~/Downloads /home/jail/Downloads \
--chdir /home/jail \
--unsetenv DBUS_SESSION_BUS_ADDRESS \
--setenv SHELL /bin/false \
--setenv HOME /home/jail \
--setenv USER nobody \
--unshare-all \
--share-net \
--new-session \
--seccomp 10 \
10< /usr/local/bin/seccomp_default_filter.bpf \
/usr/bin/firefox
)