1 from bubblebox import *
3 # Various default sandbox settings
4 DEFAULT = collect_flags(
6 bwrap_flags("--die-with-parent"),
8 bwrap_flags("--unshare-all", "--share-net", "--hostname", "bwrapped"),
10 bwrap_flags("--proc", "/proc", "--dev", "/dev", "--dir", "/tmp", "--dir", "/var", "--dir", "/run", "--symlink", "../run", "/var/run"),
11 # an empty XDG_RUNTIME_DIR
12 bwrap_flags("--perms", "0700", "--dir", XDG_RUNTIME_DIR),
14 bwrap_flags("--symlink", "usr/lib", "/lib", "--symlink", "usr/lib64", "/lib64", "--symlink", "usr/bin", "/bin", "--symlink", "usr/sbin", "/sbin"),
15 # folders we always need access to
16 host_access({ ("/usr", "/sys", "/etc"): Access.Read }),
17 # make a basic shell work
19 (".bashrc", ".bash_aliases", ".profile"): Access.Read,
24 # https://github.com/igo95862/bubblejail is a good source of paths that need allowing.
25 # We do not give access to pipewire, that needs a portal (https://docs.pipewire.org/page_portal.html).
26 DESKTOP = collect_flags(
27 # Access to screen and audio
30 ("dri", "snd"): Access.Device,
32 "/tmp/.X11-unix/": Access.Read,
33 os.environ["XAUTHORITY"]: Access.Read,
35 ("wayland*", "pulse"): Access.Read,
38 # Access to some key user configuration
40 (".config/fontconfig", ".XCompose"): Access.Read,
42 # Access to basic d-bus services (that are hopefully safe to expose...)
43 dbus_proxy_flags("--talk=org.kde.StatusNotifierWatcher.*", "--talk=org.freedesktop.Notifications.*", "--talk=org.freedesktop.ScreenSaver.*", "--talk=org.freedesktop.portal.*"),
44 # Make it possible to open websites in Firefox
46 (".mozilla/firefox/profiles.ini", ".local/share/applications"): Access.Read,
48 dbus_proxy_flags("--talk=org.mozilla.firefox.*"),