Linux namespaces and seccomp-bpf sandbox
Other than the [aforementioned exceptions](#installing), as long as your distribution provides a [supported version](SECURITY.md) of firejail, it's generally a good idea to install it from the distribution. The version can be checked with `firejail --version` after installing. You can also install one of the [released packages](https://github.com/netblue30/firejail/releases). ## Building Instructions for building and installing the current development version from source. It is recommended to use the distribution-specific instructions below when applicable, as they generate native packages, which should make integration with the rest of the system and package management easier. For other distributions, see the [generic instructions](#generic). See also [.gitlab-ci.yml](.gitlab-ci.yml) for how distribution-specific builds are done in CI. ### Arch Note: The AUR package is not maintained by us. Install [firejail-git](https://aur.archlinux.org/packages/firejail-git) from the AUR. Example: ```sh yay -S firejail-git ``` ### Debian For Debian, Ubuntu and derivatives: Note: Any ./configure flags should be passed to [`mkdeb.sh`](mkdeb.sh) (such as `./mkdeb.sh --enable-foo`). ```sh sudo apt-get update -qy sudo apt-get install -qy \ git build-essential fakeroot lintian libapparmor-dev pkg-config gawk git clone 'https://github.com/netblue30/firejail.git' && cd firejail && ./configure && make dist && ./mkdeb.sh && sudo dpkg -i ./*.deb && make installcheck ``` ### Fedora For Fedora and derivatives: Note: Any ./configure flags should be passed to [`mkrpm.sh`](platform/rpm/mkrpm.sh) (such as `./platform/rpm/mkrpm.sh --enable-foo`). ```sh sudo dnf update -y sudo dnf install -y rpm-build gcc make git clone 'https://github.com/netblue30/firejail.git' && cd firejail && ./configure && make dist && ./platform/rpm/mkrpm.sh && sudo rpm -i ./*.rpm && make installcheck ``` ### Generic Generic build/install instructions: ```sh git clone 'https://github.com/netblue30/firejail.git' && cd firejail && ./configure && make -j "$(nproc)" && sudo make install-strip && make installcheck ``` On Debian/Ubuntu you will need to install git and gcc. To build with AppArmor support (which is usually used on Debian, Ubuntu, openSUSE and derivatives), install the AppArmor development libraries and pkg-config and use the `--enable-apparmor` ./configure option: ```sh sudo apt-get install git build-essential libapparmor-dev pkg-config gawk ``` To build with SELinux support (which is usually used on Fedora, RHEL and derivatives), install libselinux1-dev (libselinux-devel on Fedora) and use the `--enable-selinux` ./configure option. Detailed information on using firejail from git is available on the [wiki](https://github.com/netblue30/firejail/wiki/Using-firejail-from-git). ## Running the sandbox Note: Make sure to use the full path to the program (for example, `firejail /usr/bin/firefox` instead of `firejail firefox`) to avoid potential firejail-in-firejail issues (see [#2877](https://github.com/netblue30/firejail/issues/2877)). To start the sandbox, prefix your command with `firejail`: ```sh firejail /usr/bin/firefox # starting Mozilla Firefox firejail /usr/bin/transmission-gtk # starting Transmission BitTorrent firejail /usr/bin/vlc # starting VideoLAN Client sudo firejail /etc/init.d/nginx start ``` Run `firejail --list` in a terminal to list all active sandboxes. Example: ```console $ firejail --list 1617:netblue:/usr/bin/firejail /usr/bin/firefox-esr 7719:netblue:/usr/bin/firejail /usr/bin/transmission-qt 7779:netblue:/usr/bin/firejail /usr/bin/galculator 7874:netblue:/usr/bin/firejail /usr/bin/vlc --started-from-file file:///home/netblue/firejail-whitelist.mp4 7916:netblue:firejail --list ``` ## Desktop integration Integrate your sandbox into your desktop by running the following two commands: ```sh firecfg --fix-sound sudo firecfg ``` The first command solves some shared memory/PID namespace bugs in PulseAudio software prior to version 9. The second command integrates Firejail into your desktop. You would need to logout and login back to apply PulseAudio changes. Start your programs the way you are used to: desktop manager menus, file manager, desktop launchers. The integration applies to any program supported by default by Firejail. There are over 900 default applications in the current Firejail version, and the number goes up with every new release. We keep the application list in [src/firecfg/firecfg.config](src/firecfg/firecfg.config) (/etc/firejail/firecfg.config when installed). ## Security profiles Most Firejail command line options can be passed to the sandbox using profile files. You can find the profiles for all supported applications in [etc/](etc/) (/etc/firejail/ when installed). We also keep a list of profile fixes for previous released versions in [etc-fixes/](etc-fixes/). If you keep additional Firejail security profiles in a public repository, please give us a link: * * Use this issue to request new profiles: * [Profile requests](https://github.com/netblue30/firejail/issues/1139) You can also use this tool to get a list of syscalls needed by a program: * [contrib/syscalls.sh](contrib/syscalls.sh) ## Uninstalling firecfg creates symlinks in /usr/local/bin, so to fully remove firejail, run the following before uninstalling: ```sh sudo firecfg --clean ``` See `man firecfg` for details. Note: Broken symlinks are ignored when searching for an executable in `$PATH`, so uninstalling without doing the above should not cause issues. ## Latest released version: 0.9.80 ## Current development version: 0.9.81 ### Landlock support - ongoing/experimental * Added on #6078, which is based on #5315 from ChrysoliteAzalea/landlock * Compile-time detection based on linux/landlock.h - if the header is found, the feature is compiled in * Runtime detection based on whether Landlock is supported by the kernel and is enabled on the system ``` … ``` ### Profile Statistics A small tool to print profile statistics. Compile and install as usual. The tool is installed in the /usr/lib/firejail directory. Run it over the profiles in /etc/profiles: ``` … ```
No open issues yet, or sync has not completed.