.TH FIREJAIL-PROFILE 5 "MONTH YEAR" "VERSION" "firejail profiles man page" .SH NAME profile \- Security profile file syntax for Firejail .SH USAGE .TP firejail \-\-profile=filename.profile .SH DESCRIPTION Several command line options can be passed to the program using profile files. Firejail chooses the profile file as follows: 1. If a profile file is provided by the user with \-\-profile option, the profile file is loaded. Example: .PP .RS $ firejail --profile=/home/netblue/icecat.profile icecat .br Reading profile /home/netblue/icecat.profile .br [...] .RE 2. If a profile file with the same name as the application is present in ~/.config/firejail directory or in /etc/firejail, the profile is loaded. ~/.config/firejail takes precedence over /etc/firejail. Example: .PP .RS $ firejail icecat .br Command name #icecat# .br Found icecat profile in /home/netblue/.config/firejail directory .br Reading profile /home/netblue/.config/firejail/icecat.profile .br [...] .RE 3. Use a default.profile file if the sandbox is started by a regular user, or a server.profile file if the sandbox is started by root. Firejail looks for these files in ~/.config/firejail directory, followed by /etc/firejail directory. To disable default profile loading, use --noroot command option. Example: .PP .RS $ firejail .br Reading profile /etc/firejail/generic.profile .br Parent pid 8553, child pid 8554 .br Child process initialized .br [...] .br .br $ firejail \-\-noprofile .br Parent pid 8553, child pid 8554 .br Child process initialized .br [...] .RE .SH Scripting Scripting commands: .TP # this is a comment .TP \f\include other.profile Include other.profile file. Example: "include /etc/firejail/disable-common.inc" other.profile file name can be prefixed with ${HOME}. This will force Firejail to look for the file in user home directory. Example: "include ${HOME}/myprofiles/profile1" will load "~/myprofiles/profile1" file. .TP \f\noblacklist file_name If the file name matches file_name, the file will not be blacklisted in any blacklist commands that follow. Example: "noblacklist ${HOME}/.mozilla" .TP \f\ignore command Ignore command. Example: "ignore seccomp" .SH Filesystem These profile entries define a chroot filesystem built on top of the existing host filesystem. Each line describes a file element that is removed from the filesystem (\fBblacklist\fR), a read-only file or directory (\fBread-only\fR), a tmpfs mounted on top of an existing directory (\fBtmpfs\fR), or mount-bind a directory or file on top of another directory or file (\fBbind\fR). Use \fBprivate\fR to set private mode. File globbing is supported, and PATH and HOME directories are searched. Examples: .TP \f\blacklist /usr/bin Remove /usr/bin directory. .TP \f\blacklist /etc/password Remove /etc/password file. .TP \f\read-only /etc/password Read-only /etc/password file. .TP tmpfs /etc Mount an empty tmpfs filesystem on top of /etc directory. .TP bind /root/config/ssh,/etc/ssh Mount-bind /root/config/ssh on /etc/ssh. .TP \f\blacklist /usr/bin/gcc* Remove all gcc files in /usr/bin (file globbing). .TP \f\blacklist ${PATH}/ifconfig Remove ifconfig command from the regular path directories. .TP \f\blacklist ${HOME}/.ssh Remove .ssh directory from user home directory. .TP \f\noblacklist ${HOME}/config/evince Prevent any new blacklist commands from blacklisting config/evince in the user home directory. Useful for defining exceptions before including a large blacklist from a file. Note that blacklisting ${HOME}/config can still make ${HOME}/config/evince effectively unreachable through filesystem traversal. .TP \f\private Mount new /root and /home/user directories in temporary filesystems. All modifications are discarded when the sandbox is closed. .TP \f\private-bin file,file Build a new /bin in a temporary filesystem, and copy the programs in the list. The same directory is also bind-mounted over /sbin, /usr/bin and /usr/sbin. .TP \f\private directory Use directory as user home. .TP \f\private-home file,directory Build a new user home in a temporary filesystem, and copy the files and directories in the list in the new home. All modifications are discarded when the sandbox is closed. .TP \f\private-dev Create a new /dev directory. Only null, full, zero, tty, pts, ptmx, random, urandom and shm devices are available. .TP \f\private-etc file,directory Build a new /etc in a temporary filesystem, and copy the files and directories in the list. All modifications are discarded when the sandbox is closed. .TP \f\whitelist file_or_directory Build a new user home in a temporary filesystem, and mount-bind file_or_directory. The modifications to file_or_directory are persistent, everything else is discarded when the sandbox is closed. .SH Filters \fBcaps\fR and \fBseccomp\fR enable Linux capabilities and seccomp filters. Examples: .TP caps Enable default Linux capabilities filter. .TP caps.drop all Blacklist all Linux capabilities. .TP caps.keep capability,capability,capability Blacklist Linux capabilities filter. .TP caps.drop capability,capability,capability Whitelist Linux capabilities filter. .TP \f\seccomp Enable default seccomp filter. The default list is as follows: mount, umount2, ptrace, kexec_load, open_by_handle_at, init_module, finit_module, delete_module, iopl, ioperm, swapon, swapoff, syslog, process_vm_readv and process_vm_writev, sysfs,_sysctl, adjtimex, clock_adjtime, lookup_dcookie, perf_event_open, fanotify_init and kcmp. .TP \f\seccomp syscall,syscall,syscall Enable seccomp filter and blacklist the system calls in the list on top of default seccomp filter. .TP \f\seccomp.drop syscall,syscall,syscall Enable seccomp filter and blacklist the system calls in the list. .TP \f\seccomp.keep syscall,syscall,syscall Enable seccomp filter and whitelist the system calls in the list. .SH User Namespace Use \fBnoroot\fR to enable an user namespace. The namespace has only one user, the current user. There is no root account defined in the namespace. .TP noroot Enable an user namespace without root user defined. .SH Resource limits These profile entries define the limits on system resources (rlimits) for the processes inside the sandbox. The limits can be modified inside the sandbox using the regular \fBulimit\fR command. Examples: .TP \f\rlimit-fsize 1024 Set the maximum file size that can be created by a process to 1024 bytes. .TP \f\rlimit-nproc 1000 Set the maximum number of processes that can be created for the real user ID of the calling process to 1000. .TP \f\rlimit-nofile 500 Set the maximum number of files that can be opened by a process to 500. .TP \f\rlimit-sigpending 200 Set the maximum number of processes that can be created for the real user ID of the calling process to 200. .SH CPU Affinity Set the CPU cores available for this sandbox. Examples: .TP cpu 1,2,3 Use only CPU cores 0, 1 and 2. .SH Control Groups Place the sandbox in an existing control group specified by the full path of the task file. Example: .TP cgroup /sys/fs/cgroup/g1/tasks The sandbox is placed in g1 control group. .SH User Environment .TP env LD_LIBRARY_PATH=/opt/test/lib Set environment variable. .br Examples: .br .br env LD_LIBRARY_PATH=/opt/test/lib .br env CFLAGS="-W -Wall -Werror" .TP nogroups Disable supplementary user groups .TP shell none Run the program directly, without a shell. .SH Networking Networking features available in profile files. .TP netfilter If a new network namespace is created, enabled default network filter. .TP netfilter filename If a new network namespace is created, enabled the network filter in filename. .TP net none Enable a new, unconnected network namespace. The only interface available in the new namespace is a new loopback interface (lo). Use this option to deny network access to programs that don't really need network access. .TP dns address Set a DNS server for the sandbox. Up to three DNS servers can be defined. .SH FILES /etc/firejail/filename.profile, $HOME/.config/firejail/filename.profile .SH LICENSE Firejail is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP Homepage: http://github.com/netblue30/firejail .SH SEE ALSO \&\flfirejail\fR\|(1), \&\flfiremon\fR\|(1), \&\flfirejail-login\fR\|(5)