What about the following /etc/firejail/firefox.profile file causes seccomp to be…
- User
What about the following /etc/firejail/firefox.profile file causes seccomp to be enabled?:
Firejail profile for firefox
Description: Safe and easy web browser from Mozilla
This file is overwritten after every install/update
Persistent local customizations
include firefox.local
Persistent global definitions
include globals.local
NOTE: sandboxing web browsers is as important as it is complex. Users might be
interested in creating custom profiles depending on use case (e.g. one for
general browsing, another for banking, ...). Consult our FAQ/issue tracker for more
info. Here are a few links to get you going.
https://github.com/netblue30/firejail/wiki/Frequently-Asked-Questions#firefox-doesnt-open-in-a-new-sandbox-instead-it-opens-a-new-tab-in-an-existing-firefox-instance
https://github.com/netblue30/firejail/wiki/Frequently-Asked-Questions#how-do-i-run-two-instances-of-firefox
https://github.com/netblue30/firejail/issues/4206#issuecomment-824806968
noblacklist {HOME}/.mozilla noblacklist {RUNUSER}/psd/firefox
blacklist /usr/libexec
mkdir {HOME}/.mozilla whitelist {HOME}/.mozilla
Add one of the following whitelist options to your firefox.local to enable KeePassXC Plugin support.
NOTE: start KeePassXC before Firefox and keep it open to allow communication between them.
#whitelist {RUNUSER}/kpxc_server #whitelist {RUNUSER}/org.keepassxc.KeePassXC.BrowserServer
whitelist /usr/share/doc whitelist /usr/share/firefox whitelist /usr/share/gnome-shell/search-providers/firefox-search-provider.ini whitelist /usr/share/gtk-doc/html whitelist /usr/share/mozilla whitelist /usr/share/webext whitelist {RUNUSER}/psd/firefox include whitelist-usr-share-common.inc
firefox requires a shell to launch on Arch - add the next line to your firefox.local to enable private-bin.
#private-bin bash,dbus-launch,dbus-send,env,firefox,sh,which
Fedora uses shell scripts to launch firefox - add the next line to your firefox.local to enable private-bin.
#private-bin basename,bash,cat,dirname,expr,false,firefox,firefox-wayland,getenforce,ln,mkdir,pidof,restorecon,rm,rmdir,sed,sh,tclsh,true,uname
Add the next line to your firefox.local to enable private-etc support - note that this must be enabled in your firefox-common.local too.
#private-etc firefox
dbus-user filter dbus-user.own org.mozilla.* dbus-user.own org.mpris.MediaPlayer2.firefox.*
Add the next line to your firefox.local to enable native notifications.
#dbus-user.talk org.freedesktop.Notifications
Add the next line to your firefox.local to allow inhibiting screensavers.
#dbus-user.talk org.freedesktop.ScreenSaver
Add the next lines to your firefox.local for plasma browser integration.
#dbus-user.own org.mpris.MediaPlayer2.plasma-browser-integration #dbus-user.talk org.kde.JobViewServer #dbus-user.talk org.kde.kuiserver
Add the next line to your firefox.local to allow screen sharing under wayland.
#dbus-user.talk org.freedesktop.portal.Desktop
Add the next line to your firefox.local if screen sharing sharing still does not work
with the above lines (might depend on the portal implementation).
#ignore noroot ignore dbus-user none
Redirect
include firefox-common.profile
- Assistant
The inclusion of the "include firefox-common.profile" line at the end of the file causes seccomp to be enabled. This line includes the contents of the "firefox-common.profile" file, which contains the seccomp rules for enabling system call filtering.
- User
Here is the firefox-common.profile file.:
Firejail profile for firefox-common
This file is overwritten after every install/update
Persistent local customizations
include firefox-common.local
Persistent global definitions
added by caller profile
#include globals.local
noexec ${HOME} breaks DRM binaries.
?BROWSER_ALLOW_DRM: ignore noexec ${HOME}
noexec ${RUNUSER} breaks DRM binaries when using profile-sync-daemon.
?BROWSER_ALLOW_DRM: ignore noexec ${RUNUSER}
Add the next line to your firefox-common.local to allow access to common programs/addons/plugins.
#include firefox-common-addons.profile
noblacklist {HOME}/.pki
include disable-common.inc include disable-devel.inc include disable-exec.inc include disable-interpreters.inc include disable-proc.inc include disable-programs.inc
mkdir {HOME}/.pki whitelist {HOME}/.local/share/pki whitelist ${HOME}/.pki include whitelist-common.inc include whitelist-run-common.inc include whitelist-runuser-common.inc include whitelist-var-common.inc
apparmor
Fixme!
apparmor-replace caps.drop all
machine-id breaks pulse audio; add it to your firefox-common.local if sound is not required.
#machine-id netfilter nodvd nogroups noinput nonewprivs
noroot breaks GTK_USE_PORTAL=1 usage, see https://github.com/netblue30/firejail/issues/2506.
noroot notv ?BROWSER_DISABLE_U2F: nou2f protocol unix,inet,inet6,netlink
The below seccomp configuration still permits chroot syscall. See https://github.com/netblue30/firejail/issues/2506 for possible workarounds.
seccomp !chroot
Disable tracelog, it breaks or causes major issues with many firefox based browsers, see https://github.com/netblue30/firejail/issues/1930.
#tracelog
disable-mnt ?BROWSER_DISABLE_U2F: private-dev
private-etc below works fine on most distributions. There are some problems on CentOS.
Add it to your firefox-common.local if you want to enable it.
#private-etc alternatives,asound.conf,ca-certificates,crypto-policies,dconf,fonts,group,gtk-2.0,gtk-3.0,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,localtime,machine-id,mailcap,mime.types,nsswitch.conf,pango,passwd,pki,pulse,resolv.conf,selinux,ssl,X11,xdg private-tmp
blacklist {PATH}/wget blacklist ${PATH}/wget2
'dbus-user none' breaks various desktop integration features like global menus, native notifications,
Gnome connector, KDE connect and power management on KDE Plasma.
dbus-user none dbus-system none
#restrict-namespaces
Tell me what seccomp !chroot does.
- Assistant
The line "seccomp !chroot" in the firefox-common.profile file specifies a system call filter using the seccomp (Secure Computing Mode) feature.
The "!" symbol negates the following parameter, in this case, "chroot". This means that the chroot system call is explicitly allowed, and all other system calls are restricted.
The "chroot" system call is used to create a new root directory for a process, effectively changing its root directory to a specified directory. By allowing the chroot system call, the profile grants Firefox the ability to change its root directory when necessary, for example, when accessing files or resources within a sandbox environment.
- User
What is the command-line parameter for disabling seccomp?
- Assistant
The command-line parameter for disabling seccomp in Firejail is
--noseccomp.You can use this parameter when launching Firejail to disable the seccomp system call filtering. This allows the application to make unrestricted system calls, which may be necessary for certain applications that require full system access.
Here's an example of how to use the
--noseccompparameter:firejail --noseccomp firefoxThis command launches the Firefox browser within Firejail without enabling seccomp filtering.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.