Страница 1 из 1
"песочница" Firejail
Добавлено: 09 дек 2019, 14:18
Olej
Это никак не "Виртуализация", но используется для тех же целей, что LXC или Docker, поэтому его уместно рассматривать именно в этом разделе...
Проект Firejail позволяет запускать
любые приложения Linux (те, кторые под подозрением) в ограниченных окружениях, без права их выхода за полномочия этого выбранного окружения.
Хотите - бинарные нативные ELF-приложения Linux, хотите - Wine приложения для Windows (что особо актуально), хотите - скриптовые приложения.
По-быстрому
описания:
Изолируйте ненадежные приложения с помощью Firejail
Оригинал: Lock Up Your Untrusted Applications in Firejail
Автор: Jack Wallen
Дата публикации: 17 июня 2016 г.
Перевод: А.Панин
Дата перевода: 17 декабря 2016 г.
ПЕСОЧНИЦА ПРОГРАММ LINUX
Ноябрь 18, 2016
Игры с песочницей. Выбираем простое и быстрое решение для изоляции приложений
22.07.2016
Re: "песочница" Firejail
Добавлено: 09 дек 2019, 14:20
Olej
Именно для подобных случаев в Linux реализован механизм изоляции приложений. Этот механизм предназначен для запуска ненадежных приложений с ограничением возможностей их окружений исполнения. По сути, приложение будет запускаться в рамках "песочницы", с доступом к ограниченному и четко контролируемому пользователем набору ресурсов.
Звучит немного путано? Можете верить или не верить, но существует программный компонент, значительно упрощающий запуск приложений в изолированных окружениях в Linux. Это утилита с именем Firejail, которая выступает в роли бинарного файла с битом SUID (Set owner User ID upon execution - бит установки идентификатора владельца бинарного файла в качестве идентификатора пользователя в момент исполнения) и сокращает риски, связанные с эксплуатацией проблем безопасности приложений. Firejail позволяет запускать в изолированном окружении приложения любого типа, будь то приложение для сервера или для настольного компьютера. Она содержит набор профилей для различных приложений для Linux и позволяет создавать ваши собственные профили, специфичные для отдельных приложений.
Существует даже графический интерфейс для Firejail под названием Firetools, который позволяет запускать приложения в изолированном окружении и активируется с помощью иконки в системном трее; кроме того, он позволяет редактировать параметры окружения исполнения приложений, управлять приложениями и собирать статистические данные.
Re: "песочница" Firejail
Добавлено: 09 дек 2019, 15:58
Olej
Всё есть в стандартных репозиториях:
Код: Выделить всё
olej@ACER:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
Код: Выделить всё
olej@ACER:~$ aptitude search firejail
p firejail - изолированная программная среда
p firejail-profiles - profiles for the firejail application sandbox
olej@ACER:~$ aptitude search firetools
p firetools - Qt frontend for the Firejail application sandbox
Код: Выделить всё
olej@nvidia:~$ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 19.2 Tina
Release: 19.2
Codename: tina
Код: Выделить всё
olej@nvidia:~$ aptitude search firejail
p firejail - sandbox to restrict the application environment
p firejail:i386 - sandbox to restrict the application environment
p firejail-profiles - profiles for the firejail application sandbox
olej@nvidia:~$ aptitude search firetools
p firetools - Qt frontend for the Firejail application sandbox
p firetools:i386 - Qt frontend for the Firejail application sandbox
Re: "песочница" Firejail
Добавлено: 09 дек 2019, 16:21
Olej
Olej писал(а): ↑09 дек 2019, 15:58
Всё есть в стандартных репозиториях:
Код: Выделить всё
olej@ACER:~$ sudo apt install firejail
[sudo] пароль для olej:
Чтение списков пакетов… Готово
Построение дерева зависимостей
Чтение информации о состоянии… Готово
Будут установлены следующие дополнительные пакеты:
firejail-profiles libgtkglext1 libpango1.0-0 libpangox-1.0-0 python-bcrypt python-future python-gi-cairo python-gtkglext1 python-lz4 python-lzo
python-nacl python-opengl python-paramiko python-pyasn1 python-rencode ssh-askpass xpra xserver-xorg-input-void xserver-xorg-video-dummy
Предлагаемые пакеты:
python-future-doc python-nacl-doc python-gssapi python-pyopencl python-avahi python-netifaces cups-pdf python-cups v4l2loopback-dkms python-yaml
python-uinput
Следующие НОВЫЕ пакеты будут установлены:
firejail firejail-profiles libgtkglext1 libpango1.0-0 libpangox-1.0-0 python-bcrypt python-future python-gi-cairo python-gtkglext1 python-lz4 python-lzo
python-nacl python-opengl python-paramiko python-pyasn1 python-rencode ssh-askpass xpra xserver-xorg-input-void xserver-xorg-video-dummy
Обновлено 0 пакетов, установлено 20 новых пакетов, для удаления отмечено 0 пакетов, и 64 пакетов не обновлено.
Необходимо скачать 4 183 kB архивов.
После данной операции объём занятого дискового пространства возрастёт на 22,1 MB.
Хотите продолжить? [Д/н] y
Пол:1 http://deb.debian.org/debian buster/main amd64 firejail amd64 0.9.58.2-2 [301 kB]
Пол:2 http://deb.debian.org/debian buster/main amd64 firejail-profiles all 0.9.58.2-2 [70,4 kB]
Пол:3 http://deb.debian.org/debian buster/main amd64 libpangox-1.0-0 amd64 0.0.2-5+b2 [42,3 kB]
Пол:4 http://deb.debian.org/debian buster/main amd64 libgtkglext1 amd64 1.2.0-9 [96,8 kB]
Пол:5 http://deb.debian.org/debian buster/main amd64 libpango1.0-0 amd64 1.42.4-7~deb10u1 [37,1 kB]
Пол:6 http://deb.debian.org/debian buster/main amd64 python-bcrypt amd64 3.1.6-1 [31,5 kB]
Пол:7 http://deb.debian.org/debian buster/main amd64 python-future all 0.16.0-1 [348 kB]
Пол:8 http://deb.debian.org/debian buster/main amd64 python-gi-cairo amd64 3.30.4-1 [24,6 kB]
Пол:9 http://deb.debian.org/debian buster/main amd64 python-opengl all 3.1.0+dfsg-2 [490 kB]
Пол:10 http://deb.debian.org/debian buster/main amd64 python-gtkglext1 amd64 1.1.0-9.1 [153 kB]
Пол:11 http://deb.debian.org/debian buster/main amd64 python-lz4 amd64 1.1.0+dfsg-1 [24,9 kB]
Пол:12 http://deb.debian.org/debian buster/main amd64 python-lzo amd64 1.12-2 [7 200 B]
Пол:13 http://deb.debian.org/debian buster/main amd64 python-nacl amd64 1.3.0-2 [49,5 kB]
Пол:14 http://deb.debian.org/debian buster/main amd64 python-pyasn1 all 0.4.2-3 [57,6 kB]
Пол:15 http://deb.debian.org/debian buster/main amd64 python-paramiko all 2.4.2-0.1 [120 kB]
Пол:16 http://deb.debian.org/debian buster/main amd64 python-rencode amd64 1.0.5-1+b2 [38,0 kB]
Пол:17 http://deb.debian.org/debian buster/main amd64 ssh-askpass amd64 1:1.2.4.1-10 [31,5 kB]
Пол:18 http://deb.debian.org/debian buster/main amd64 xserver-xorg-input-void amd64 1:1.4.1-1+b2 [16,6 kB]
Пол:19 http://deb.debian.org/debian buster/main amd64 xserver-xorg-video-dummy amd64 1:0.3.8-1+b1 [19,1 kB]
Пол:20 http://deb.debian.org/debian buster/main amd64 xpra amd64 2.4.3+dfsg1-1 [2 222 kB]
Получено 4 183 kB за 2с (2 730 kB/s)
Выбор ранее не выбранного пакета firejail.
(Чтение базы данных … на данный момент установлено 415212 файлов и каталогов.)
Подготовка к распаковке …/00-firejail_0.9.58.2-2_amd64.deb …
Распаковывается firejail (0.9.58.2-2) …
Выбор ранее не выбранного пакета firejail-profiles.
Подготовка к распаковке …/01-firejail-profiles_0.9.58.2-2_all.deb …
Распаковывается firejail-profiles (0.9.58.2-2) …
Выбор ранее не выбранного пакета libpangox-1.0-0:amd64.
Подготовка к распаковке …/02-libpangox-1.0-0_0.0.2-5+b2_amd64.deb …
Распаковывается libpangox-1.0-0:amd64 (0.0.2-5+b2) …
Выбор ранее не выбранного пакета libgtkglext1:amd64.
Подготовка к распаковке …/03-libgtkglext1_1.2.0-9_amd64.deb …
Распаковывается libgtkglext1:amd64 (1.2.0-9) …
Выбор ранее не выбранного пакета libpango1.0-0:amd64.
Подготовка к распаковке …/04-libpango1.0-0_1.42.4-7~deb10u1_amd64.deb …
Распаковывается libpango1.0-0:amd64 (1.42.4-7~deb10u1) …
Выбор ранее не выбранного пакета python-bcrypt.
Подготовка к распаковке …/05-python-bcrypt_3.1.6-1_amd64.deb …
Распаковывается python-bcrypt (3.1.6-1) …
Выбор ранее не выбранного пакета python-future.
Подготовка к распаковке …/06-python-future_0.16.0-1_all.deb …
Распаковывается python-future (0.16.0-1) …
Выбор ранее не выбранного пакета python-gi-cairo.
Подготовка к распаковке …/07-python-gi-cairo_3.30.4-1_amd64.deb …
Распаковывается python-gi-cairo (3.30.4-1) …
Выбор ранее не выбранного пакета python-opengl.
Подготовка к распаковке …/08-python-opengl_3.1.0+dfsg-2_all.deb …
Распаковывается python-opengl (3.1.0+dfsg-2) …
Выбор ранее не выбранного пакета python-gtkglext1.
Подготовка к распаковке …/09-python-gtkglext1_1.1.0-9.1_amd64.deb …
Распаковывается python-gtkglext1 (1.1.0-9.1) …
Выбор ранее не выбранного пакета python-lz4.
Подготовка к распаковке …/10-python-lz4_1.1.0+dfsg-1_amd64.deb …
Распаковывается python-lz4 (1.1.0+dfsg-1) …
Выбор ранее не выбранного пакета python-lzo.
Подготовка к распаковке …/11-python-lzo_1.12-2_amd64.deb …
Распаковывается python-lzo (1.12-2) …
Выбор ранее не выбранного пакета python-nacl.
Подготовка к распаковке …/12-python-nacl_1.3.0-2_amd64.deb …
Распаковывается python-nacl (1.3.0-2) …
Выбор ранее не выбранного пакета python-pyasn1.
Подготовка к распаковке …/13-python-pyasn1_0.4.2-3_all.deb …
Распаковывается python-pyasn1 (0.4.2-3) …
Выбор ранее не выбранного пакета python-paramiko.
Подготовка к распаковке …/14-python-paramiko_2.4.2-0.1_all.deb …
Распаковывается python-paramiko (2.4.2-0.1) …
Выбор ранее не выбранного пакета python-rencode.
Подготовка к распаковке …/15-python-rencode_1.0.5-1+b2_amd64.deb …
Распаковывается python-rencode (1.0.5-1+b2) …
Выбор ранее не выбранного пакета ssh-askpass.
Подготовка к распаковке …/16-ssh-askpass_1%3a1.2.4.1-10_amd64.deb …
Распаковывается ssh-askpass (1:1.2.4.1-10) …
Выбор ранее не выбранного пакета xserver-xorg-input-void.
Подготовка к распаковке …/17-xserver-xorg-input-void_1%3a1.4.1-1+b2_amd64.deb …
Распаковывается xserver-xorg-input-void (1:1.4.1-1+b2) …
Выбор ранее не выбранного пакета xserver-xorg-video-dummy.
Подготовка к распаковке …/18-xserver-xorg-video-dummy_1%3a0.3.8-1+b1_amd64.deb …
Распаковывается xserver-xorg-video-dummy (1:0.3.8-1+b1) …
Выбор ранее не выбранного пакета xpra.
Подготовка к распаковке …/19-xpra_2.4.3+dfsg1-1_amd64.deb …
Распаковывается xpra (2.4.3+dfsg1-1) …
Настраивается пакет libpangox-1.0-0:amd64 (0.0.2-5+b2) …
Настраивается пакет firejail (0.9.58.2-2) …
Настраивается пакет python-opengl (3.1.0+dfsg-2) …
Настраивается пакет python-rencode (1.0.5-1+b2) …
Настраивается пакет firejail-profiles (0.9.58.2-2) …
Настраивается пакет libgtkglext1:amd64 (1.2.0-9) …
Настраивается пакет python-bcrypt (3.1.6-1) …
Настраивается пакет xserver-xorg-video-dummy (1:0.3.8-1+b1) …
Настраивается пакет ssh-askpass (1:1.2.4.1-10) …
update-alternatives: используется /usr/lib/ssh/x11-ssh-askpass для предоставления /usr/bin/ssh-askpass (ssh-askpass) в автоматическом режиме
Настраивается пакет python-lzo (1.12-2) …
Настраивается пакет python-pyasn1 (0.4.2-3) …
Настраивается пакет python-nacl (1.3.0-2) …
Настраивается пакет python-paramiko (2.4.2-0.1) …
Настраивается пакет xserver-xorg-input-void (1:1.4.1-1+b2) …
Настраивается пакет python-gi-cairo (3.30.4-1) …
Настраивается пакет python-future (0.16.0-1) …
update-alternatives: используется /usr/bin/python2-futurize для предоставления /usr/bin/futurize (futurize) в автоматическом режиме
update-alternatives: используется /usr/bin/python2-pasteurize для предоставления /usr/bin/pasteurize (pasteurize) в автоматическом режиме
Настраивается пакет libpango1.0-0:amd64 (1.42.4-7~deb10u1) …
Настраивается пакет python-gtkglext1 (1.1.0-9.1) …
Настраивается пакет xpra (2.4.3+dfsg1-1) …
Настраивается пакет python-lz4 (1.1.0+dfsg-1) …
Обрабатываются триггеры для mime-support (3.62) …
Обрабатываются триггеры для libc-bin (2.28-10) …
Обрабатываются триггеры для systemd (241-7~deb10u2) …
Обрабатываются триггеры для man-db (2.8.5-2) …
Обрабатываются триггеры для dbus (1.12.16-1) …
Обрабатываются триггеры для shared-mime-info (1.10-1) …
Обрабатываются триггеры для desktop-file-utils (0.23-4) …
Всё это сделано, как видно, на Python, причём Python2.
Код: Выделить всё
olej@ACER:~$ sudo apt install firetools
Чтение списков пакетов… Готово
Построение дерева зависимостей
Чтение информации о состоянии… Готово
Следующие НОВЫЕ пакеты будут установлены:
firetools
Обновлено 0 пакетов, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 64 пакетов не обновлено.
Необходимо скачать 230 kB архивов.
После данной операции объём занятого дискового пространства возрастёт на 681 kB.
Пол:1 http://deb.debian.org/debian buster/main amd64 firetools amd64 0.9.58-1 [230 kB]
Получено 230 kB за 0с (878 kB/s)
Выбор ранее не выбранного пакета firetools.
(Чтение базы данных … на данный момент установлено 419507 файлов и каталогов.)
Подготовка к распаковке …/firetools_0.9.58-1_amd64.deb …
Распаковывается firetools (0.9.58-1) …
Настраивается пакет firetools (0.9.58-1) …
Обрабатываются триггеры для mime-support (3.62) …
Обрабатываются триггеры для man-db (2.8.5-2) …
Обрабатываются триггеры для desktop-file-utils (0.23-4) …
Re: "песочница" Firejail
Добавлено: 09 дек 2019, 20:37
Olej
Olej писал(а): ↑09 дек 2019, 15:58
Всё есть в стандартных репозиториях:
Это и есть наш Firetools.
Запустим в нем терминал (значок):
f2.png
- (15.16 КБ) 619 скачиваний
Создаём новые ограниченные в правах приложения:
Re: "песочница" Firejail
Добавлено: 10 дек 2019, 01:13
Olej
А вот как изолированное окружение запускается из командной строки...
Пробуем скачивание из Интернет (я скачиваю свою книгу, но вы можете взять любой известный URL):
Код: Выделить всё
olej@ACER:~/2019_WORK/FAMILY$ wget https://drive.google.com/file/d/1QXNraOC-zHeE6RjstixlUGtfK6S1w6XN/view?usp=sharing
--2019-12-10 00:09:47-- https://drive.google.com/file/d/1QXNraOC-zHeE6RjstixlUGtfK6S1w6XN/view?usp=sharing
Распознаётся drive.google.com (drive.google.com)… 172.217.16.14, 2a00:1450:401b:804::200e
Подключение к drive.google.com (drive.google.com)|172.217.16.14|:443... соединение установлено.
HTTP-запрос отправлен. Ожидание ответа… 200 OK
Длина: нет данных [text/html]
Сохранение в: «view?usp=sharing»
view?usp=sharing [ <=> ] 67,49K --.-KB/s за 0,09s
2019-12-10 00:09:47 (725 KB/s) - «view?usp=sharing» сохранён [69109]
А теперь абсолютно то же самое, но в окружении в котором запрещён сетевой доступ:
Код: Выделить всё
olej@ACER:~/2019_WORK/FAMILY$ firejail --noprofile --net=none wget https://drive.google.com/file/d/1QXNraOC-zHeE6RjstixlUGtfK6S1w6XN/view?usp=sharing
Parent pid 27880, child pid 27881
Child process initialized in 29.84 ms
--2019-12-10 00:10:47-- https://drive.google.com/file/d/1QXNraOC-zHeE6RjstixlUGtfK6S1w6XN/view?usp=sharing
Распознаётся drive.google.com (drive.google.com)… 2a00:1450:401b:804::200e, 172.217.16.14
Подключение к drive.google.com (drive.google.com)|2a00:1450:401b:804::200e|:443... ошибка: Сеть недоступна.
Подключение к drive.google.com (drive.google.com)|172.217.16.14|:443... ошибка: Сеть недоступна.
Parent is shutting down, bye...
Вот так!
Re: "песочница" Firejail
Добавлено: 10 дек 2019, 01:16
Olej
Olej писал(а): ↑10 дек 2019, 01:13
А вот как изолированное окружение запускается из командной строки...
Чтоб мало не показалось

:
Код: Выделить всё
olej@ACER:~/2019_WORK/FAMILY$ firejail --help
firejail - version 0.9.58.2
Firejail is a SUID sandbox program that reduces the risk of security breaches by
restricting the running environment of untrusted applications using Linux
namespaces.
Usage: firejail [options] [program and arguments]
Options:
-- - signal the end of options and disables further option processing.
--allow-debuggers - allow tools such as strace and gdb inside the sandbox.
--allusers - all user home directories are visible inside the sandbox.
--apparmor - enable AppArmor confinement.
--apparmor.print=name|pid - print apparmor status.
--appimage - sandbox an AppImage application.
--audit[=test-program] - audit the sandbox.
--bandwidth=name|pid - set bandwidth limits.
--bind=dirname1,dirname2 - mount-bind dirname1 on top of dirname2.
--bind=filename1,filename2 - mount-bind filename1 on top of filename2.
--blacklist=filename - blacklist directory or file.
--build - build a whitelisted profile for the application.
--build=filename - build a whitelisted profile for the application.
--caps - enable default Linux capabilities filter.
--caps.drop=all - drop all capabilities.
--caps.drop=capability,capability - blacklist capabilities filter.
--caps.keep=capability,capability - whitelist capabilities filter.
--caps.print=name|pid - print the caps filter.
--cgroup=tasks-file - place the sandbox in the specified control group.
--chroot=dirname - chroot into directory.
--cpu=cpu-number,cpu-number - set cpu affinity.
--cpu.print=name|pid - print the cpus in use.
--debug - print sandbox debug messages.
--debug-blacklists - debug blacklisting.
--debug-caps - print all recognized capabilities.
--debug-errnos - print all recognized error numbers.
--debug-private-lib - debug for --private-lib option.
--debug-protocols - print all recognized protocols.
--debug-syscalls - print all recognized system calls.
--debug-whitelists - debug whitelisting.
--defaultgw=address - configure default gateway.
--dns=address - set DNS server.
--dns.print=name|pid - print DNS configuration.
--env=name=value - set environment variable.
--fs.print=name|pid - print the filesystem log.
--get=name|pid filename - get a file from sandbox container.
--help, -? - this help screen.
--hostname=name - set sandbox hostname.
--hosts-file=file - use file as /etc/hosts.
--ignore=command - ignore command in profile files.
--interface=name - move interface in sandbox.
--ip=address - set interface IP address.
--ip=none - no IP address and no default gateway are configured.
--ip6=address - set interface IPv6 address.
--iprange=address,address - configure an IP address in this range.
--ipc-namespace - enable a new IPC namespace.
--join=name|pid - join the sandbox.
--join-filesystem=name|pid - join the mount namespace.
--join-network=name|pid - join the network namespace.
--join-or-start=name|pid - join the sandbox or start a new one.
--keep-dev-shm - /dev/shm directory is untouched (even with --private-dev).
--keep-var-tmp - /var/tmp directory is untouched.
--list - list all sandboxes.
--ls=name|pid dir_or_filename - list files in sandbox container.
--mac=xx:xx:xx:xx:xx:xx - set interface MAC address.
--machine-id - preserve /etc/machine-id
--memory-deny-write-execute - seccomp filter to block attempts to create
memory mappings that are both writable and executable.
--mtu=number - set interface MTU.
--name=name - set sandbox name.
--net=bridgename - enable network namespaces and connect to this bridge.
--net=ethernet_interface - enable network namespaces and connect to this
Ethernet interface.
--net=none - enable a new, unconnected network namespace.
--net.print=name|pid - print network interface configuration.
--netfilter[=filename,arg1,arg2,arg3 ...] - enable firewall.
--netfilter.print=name|pid - print the firewall.
--netfilter6=filename - enable IPv6 firewall.
--netfilter6.print=name|pid - print the IPv6 firewall.
--netmask=address - define a network mask when dealing with unconfigured parrent interfaces.
--netns=name - Run the program in a named, persistent network namespace.
--netstats - monitor network statistics.
--nice=value - set nice value.
--no3d - disable 3D hardware acceleration.
--noblacklist=filename - disable blacklist for file or directory.
--nodbus - disable D-Bus access.
--nodvd - disable DVD and audio CD devices.
--noexec=filename - remount the file or directory noexec nosuid and nodev.
--nogroups - disable supplementary groups.
--nonewprivs - sets the NO_NEW_PRIVS prctl.
--noprofile - do not use a security profile.
--noroot - install a user namespace with only the current user.
--nosound - disable sound system.
--noautopulse - disable automatic ~/.config/pulse init.
--novideo - disable video devices.
--nou2f - disable U2F devices.
--nowhitelist=filename - disable whitelist for file or directory .
--output=logfile - stdout logging and log rotation.
--output-stderr=logfile - stdout and stderr logging and log rotation.
--overlay - mount a filesystem overlay on top of the current filesystem.
--overlay-named=name - mount a filesystem overlay on top of the current
filesystem, and store it in name directory.
--overlay-tmpfs - mount a temporary filesystem overlay on top of the
current filesystem.
--overlay-clean - clean all overlays stored in $HOME/.firejail directory.
--private - temporary home directory.
--private=directory - use directory as user home.
--private-cache - temporary ~/.cache directory.
--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.
--private-bin=file,file - build a new /bin in a temporary filesystem,
and copy the programs in the list.
--private-dev - create a new /dev directory with a small number of
common device files.
--private-etc=file,directory - build a new /etc in a temporary
filesystem, and copy the files and directories in the list.
--private-tmp - mount a tmpfs on top of /tmp directory.
--private-opt=file,directory - build a new /opt in a temporary filesystem.
--private-srv=file,directory - build a new /srv in a temporary filesystem.
--profile=filename|profile_name - use a custom profile.
--profile.print=name|pid - print the name of profile file.
--profile-path=directory - use this directory to look for profile files.
--protocol=protocol,protocol,protocol - enable protocol filter.
--protocol.print=name|pid - print the protocol filter.
--put=name|pid src-filename dest-filename - put a file in sandbox
container.
--quiet - turn off Firejail's output.
--read-only=filename - set directory or file read-only..
--read-write=filename - set directory or file read-write.
--rlimit-as=number - set the maximum size of the process's virtual memory
(address space) in bytes.
--rlimit-cpu=number - set the maximum CPU time in seconds.
--rlimit-fsize=number - set the maximum file size that can be created
by a process.
--rlimit-nofile=number - set the maximum number of files that can be
opened by a process.
--rlimit-nproc=number - set the maximum number of processes that can be
created for the real user ID of the calling process.
--rlimit-sigpending=number - set the maximum number of pending signals
for a process.
--rmenv=name - remove environment variable in the new sandbox.
--scan - ARP-scan all the networks from inside a network namespace.
--seccomp - enable seccomp filter and apply the default blacklist.
--seccomp=syscall,syscall,syscall - enable seccomp filter, blacklist the
default syscall list and the syscalls specified by the command.
--seccomp.block-secondary - build only the native architecture filters.
--seccomp.drop=syscall,syscall,syscall - enable seccomp filter, and
blacklist the syscalls specified by the command.
--seccomp.keep=syscall,syscall,syscall - enable seccomp filter, and
whitelist the syscalls specified by the command.
--seccomp.print=name|pid - print the seccomp filter for the sandbox
identified by name or PID.
--shell=none - run the program directly without a user shell.
--shell=program - set default user shell.
--shutdown=name|pid - shutdown the sandbox identified by name or PID.
--timeout=hh:mm:ss - kill the sandbox automatically after the time
has elapsed.
--tmpfs=dirname - mount a tmpfs filesystem on directory dirname.
--top - monitor the most CPU-intensive sandboxes.
--trace - trace open, access and connect system calls.
--tracelog - add a syslog message for every access to files or
directories blacklisted by the security profile.
--tree - print a tree of all sandboxed processes.
--tunnel[=devname] - connect the sandbox to a tunnel created by
firetunnel utility.
--version - print program version and exit.
--veth-name=name - use this name for the interface connected to the bridge.
--whitelist=filename - whitelist directory or file.
--writable-etc - /etc directory is mounted read-write.
--writable-run-user - allow access to /run/user/$UID/systemd and
/run/user/$UID/gnupg.
--writable-var - /var directory is mounted read-write.
--writable-var-log - use the real /var/log directory, not a clone.
--x11 - enable X11 sandboxing. The software checks first if Xpra is
installed, then it checks if Xephyr is installed. If all fails, it will
attempt to use X11 security extension.
--x11=none - disable access to X11 sockets.
--x11=xephyr - enable Xephyr X11 server. The window size is 800x600.
--x11=xorg - enable X11 security extension.
--x11=xpra - enable Xpra X11 server.
--x11=xvfb - enable Xvfb X11 server.
--xephyr-screen=WIDTHxHEIGHT - set screen size for --x11=xephyr.
Examples:
$ firejail firefox
start Mozilla Firefox
$ firejail --debug firefox
debug Firefox sandbox
$ firejail --private --dns=8.8.8.8 firefox
start Firefox with a new, empty home directory, and a well-known DNS
server setting.
$ firejail --net=eth0 firefox
start Firefox in a new network namespace
$ firejail --x11=xorg firefox
start Firefox and sandbox X11
$ firejail --list
list all running sandboxes
License GPL version 2 or later
Homepage: https://firejail.wordpress.com