aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar glitsj16 <glitsj16@users.noreply.github.com>2023-01-04 18:51:36 +0000
committerLibravatar GitHub <noreply@github.com>2023-01-04 18:51:36 +0000
commit86b4561ffbb27fc943a1ceb95ea7eecf149d36a7 (patch)
treef5380e6c00f8ce5a0aa6832f07813bd556304428
parentlinuxqq: drop comment (diff)
parentMerge pull request #5564 from glitsj16/claws-mail+sylpheed (diff)
downloadfirejail-86b4561ffbb27fc943a1ceb95ea7eecf149d36a7.tar.gz
firejail-86b4561ffbb27fc943a1ceb95ea7eecf149d36a7.tar.zst
firejail-86b4561ffbb27fc943a1ceb95ea7eecf149d36a7.zip
Merge branch 'netblue30:master' into linuxqq
-rw-r--r--etc/inc/disable-programs.inc5
-rw-r--r--etc/profile-a-l/chatterino.profile92
-rw-r--r--etc/profile-a-l/claws-mail.profile10
-rw-r--r--etc/profile-a-l/electron-hardened.inc.profile10
-rw-r--r--etc/profile-a-l/electron.profile4
-rw-r--r--etc/profile-a-l/firefox-common.profile2
-rw-r--r--etc/profile-m-z/sylpheed.profile5
-rw-r--r--etc/profile-m-z/ytmdesktop.profile2
-rw-r--r--src/firecfg/firecfg.config1
-rw-r--r--src/firejail/firejail.h1
-rw-r--r--src/firejail/main.c5
-rw-r--r--src/firejail/profile.c16
-rw-r--r--src/firejail/sandbox.c9
13 files changed, 154 insertions, 8 deletions
diff --git a/etc/inc/disable-programs.inc b/etc/inc/disable-programs.inc
index 1ea77495b..7d7f84d4b 100644
--- a/etc/inc/disable-programs.inc
+++ b/etc/inc/disable-programs.inc
@@ -116,6 +116,7 @@ blacklist ${HOME}/.cache/fossamail
116blacklist ${HOME}/.cache/fractal 116blacklist ${HOME}/.cache/fractal
117blacklist ${HOME}/.cache/freecol 117blacklist ${HOME}/.cache/freecol
118blacklist ${HOME}/.cache/gajim 118blacklist ${HOME}/.cache/gajim
119blacklist ${HOME}/.cache/gdfuse
119blacklist ${HOME}/.cache/geary 120blacklist ${HOME}/.cache/geary
120blacklist ${HOME}/.cache/geeqie 121blacklist ${HOME}/.cache/geeqie
121blacklist ${HOME}/.cache/gegl-0.4 122blacklist ${HOME}/.cache/gegl-0.4
@@ -437,6 +438,7 @@ blacklist ${HOME}/.config/gajim
437blacklist ${HOME}/.config/galculator 438blacklist ${HOME}/.config/galculator
438blacklist ${HOME}/.config/gallery-dl 439blacklist ${HOME}/.config/gallery-dl
439blacklist ${HOME}/.config/gconf 440blacklist ${HOME}/.config/gconf
441blacklist ${HOME}/.config/gdfuse
440blacklist ${HOME}/.config/geany 442blacklist ${HOME}/.config/geany
441blacklist ${HOME}/.config/geary 443blacklist ${HOME}/.config/geary
442blacklist ${HOME}/.config/gedit 444blacklist ${HOME}/.config/gedit
@@ -709,6 +711,7 @@ blacklist ${HOME}/.frozen-bubble
709blacklist ${HOME}/.funnyboat 711blacklist ${HOME}/.funnyboat
710blacklist ${HOME}/.g8 712blacklist ${HOME}/.g8
711blacklist ${HOME}/.gallery-dl.conf 713blacklist ${HOME}/.gallery-dl.conf
714blacklist ${HOME}/.gdfuse
712blacklist ${HOME}/.geekbench5 715blacklist ${HOME}/.geekbench5
713blacklist ${HOME}/.gimp* 716blacklist ${HOME}/.gimp*
714blacklist ${HOME}/.gist 717blacklist ${HOME}/.gist
@@ -877,6 +880,7 @@ blacklist ${HOME}/.local/share/caja-python
877blacklist ${HOME}/.local/share/calligragemini 880blacklist ${HOME}/.local/share/calligragemini
878blacklist ${HOME}/.local/share/cantata 881blacklist ${HOME}/.local/share/cantata
879blacklist ${HOME}/.local/share/cdprojektred 882blacklist ${HOME}/.local/share/cdprojektred
883blacklist ${HOME}/.local/share/chatterino
880blacklist ${HOME}/.local/share/clipit 884blacklist ${HOME}/.local/share/clipit
881blacklist ${HOME}/.local/share/com.github.johnfactotum.Foliate 885blacklist ${HOME}/.local/share/com.github.johnfactotum.Foliate
882blacklist ${HOME}/.local/share/contacts 886blacklist ${HOME}/.local/share/contacts
@@ -898,6 +902,7 @@ blacklist ${HOME}/.local/share/feral-interactive
898blacklist ${HOME}/.local/share/five-or-more 902blacklist ${HOME}/.local/share/five-or-more
899blacklist ${HOME}/.local/share/freecol 903blacklist ${HOME}/.local/share/freecol
900blacklist ${HOME}/.local/share/gajim 904blacklist ${HOME}/.local/share/gajim
905blacklist ${HOME}/.local/share/gdfuse
901blacklist ${HOME}/.local/share/geary 906blacklist ${HOME}/.local/share/geary
902blacklist ${HOME}/.local/share/geeqie 907blacklist ${HOME}/.local/share/geeqie
903blacklist ${HOME}/.local/share/ghostwriter 908blacklist ${HOME}/.local/share/ghostwriter
diff --git a/etc/profile-a-l/chatterino.profile b/etc/profile-a-l/chatterino.profile
new file mode 100644
index 000000000..4dfd85740
--- /dev/null
+++ b/etc/profile-a-l/chatterino.profile
@@ -0,0 +1,92 @@
1# Firejail profile for Chatterino
2# Description: Chat client for https://twitch.tv
3# This file is overwritten after every install/update
4# Persistent local customizations
5include chatterino.local
6# Persistent global definitions
7include globals.local
8
9# To upload images, whitelist/noblacklist their path in chatterino.local.
10#whitelist ${PICTURES}
11# For custom notification sounds, whitelist/noblacklist their path in chatterino.local.
12#whitelist ${MUSIC}
13
14# Also allow access to mpv/vlc, they're usable via streamlink.
15noblacklist ${HOME}/.config/mpv
16noblacklist ${HOME}/.config/pulse
17noblacklist ${HOME}/.config/vlc
18noblacklist ${HOME}/.local/share/chatterino
19noblacklist ${HOME}/.local/share/vlc
20
21# Allow Lua for mpv (blacklisted by disable-interpreters.inc)
22include allow-lua.inc
23
24# Allow Python for Streamlink integration (blacklisted by disable-interpreters.inc)
25include allow-python3.inc
26
27include disable-common.inc
28include disable-devel.inc
29include disable-exec.inc
30include disable-interpreters.inc
31include disable-proc.inc
32include disable-programs.inc
33include disable-xdg.inc
34
35# Also allow read-only access to mpv/VLC, they're usable via streamlink.
36mkdir ${HOME}/.local/share/chatterino
37# VLC preferences will fail to save with read-only set.
38whitelist ${HOME}/.local/share/chatterino
39whitelist-ro ${HOME}/.config/mpv
40whitelist-ro ${HOME}/.config/pulse
41whitelist-ro ${HOME}/.config/vlc
42whitelist-ro ${HOME}/.local/share/vlc
43include whitelist-common.inc
44include whitelist-run-common.inc
45include whitelist-runuser-common.inc
46include whitelist-usr-share-common.inc
47include whitelist-var-common.inc
48
49# Streamlink+VLC doesn't seem to close properly with apparmor enabled.
50#apparmor
51caps.drop all
52netfilter
53nodvd
54nogroups
55nonewprivs
56noprinters
57noroot
58notv
59nou2f
60# Netlink is required for streamlink integration.
61protocol unix,inet,inet6,netlink
62# Seccomp may break browser integration.
63seccomp
64seccomp.block-secondary
65tracelog
66
67disable-mnt
68# Add more private-bin lines for browsers or video players to chatterino.local if wanted.
69private-bin chatterino,cvlc,env,ffmpeg,mpv,nvlc,pgrep,python*,qvlc,rvlc,streamlink,svlc,vlc
70# private-cache may cause issues with mpv (see #2838)
71private-cache
72private-dev
73private-etc alsa,alternatives,asound.conf,ca-certificates,dbus-1,fonts,hostname,hosts,kde4rc,kde5rc,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,nvidia,passwd,pulse,resolv.conf,rpc,services,ssl,Trolltech.conf,X11
74private-srv none
75private-tmp
76
77dbus-user filter
78dbus-user.own com.chatterino.*
79# Allow notifications.
80dbus-user.talk org.freedesktop.Notifications
81# For media player integration.
82dbus-user.talk org.freedesktop.ScreenSaver
83?ALLOW_TRAY: dbus-user.talk org.kde.StatusNotifierWatcher
84dbus-user.own org.mpris.MediaPlayer2.chatterino
85dbus-user.talk org.mpris.MediaPlayer2.Player
86dbus-system none
87
88# Prevents browsers/players from lingering after Chatterino is closed.
89#deterministic-shutdown
90# memory-deny-write-execute may break streamlink and browser integration.
91#memory-deny-write-execute
92restrict-namespaces
diff --git a/etc/profile-a-l/claws-mail.profile b/etc/profile-a-l/claws-mail.profile
index 691657fa0..ce7b30122 100644
--- a/etc/profile-a-l/claws-mail.profile
+++ b/etc/profile-a-l/claws-mail.profile
@@ -1,5 +1,5 @@
1# Firejail profile for claws-mail 1# Firejail profile for claws-mail
2# Description: Fast, lightweight and user-friendly GTK+2 based email client 2# Description: Fast, lightweight and user-friendly GTK based email client
3# This file is overwritten after every install/update 3# This file is overwritten after every install/update
4# Persistent local customizations 4# Persistent local customizations
5include claws-mail.local 5include claws-mail.local
@@ -22,9 +22,15 @@ whitelist /usr/share/doc/claws-mail
22 22
23dbus-user filter 23dbus-user filter
24dbus-user.talk ca.desrt.dconf 24dbus-user.talk ca.desrt.dconf
25dbus-user.talk org.gnome.keyring.SystemPrompter
26# Add the next line to your claws-mail.local if you use the notification plugin. 25# Add the next line to your claws-mail.local if you use the notification plugin.
27# dbus-user.talk org.freedesktop.Notifications 26# dbus-user.talk org.freedesktop.Notifications
27dbus-user.talk org.freedesktop.secrets
28dbus-user.talk org.gnome.keyring
29dbus-user.talk org.gnome.keyring.PrivatePrompter
30dbus-user.talk org.gnome.keyring.SystemPrompter
31dbus-user.talk org.gnome.seahorse
32dbus-user.talk org.gnome.seahorse.Application
33dbus-user.talk org.mozilla.*
28 34
29# Redirect 35# Redirect
30include email-common.profile 36include email-common.profile
diff --git a/etc/profile-a-l/electron-hardened.inc.profile b/etc/profile-a-l/electron-hardened.inc.profile
new file mode 100644
index 000000000..eacf5cebe
--- /dev/null
+++ b/etc/profile-a-l/electron-hardened.inc.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for chrome-common-hardened.inc
2# This file is overwritten after every install/update
3# Persistent local customizations
4include electron-hardened.inc.local
5# Persistent global definitions
6# added by caller profile
7#include globals.local
8
9# Redirect
10include chrome-common-hardened.inc.profile
diff --git a/etc/profile-a-l/electron.profile b/etc/profile-a-l/electron.profile
index c1d337abd..c15e43399 100644
--- a/etc/profile-a-l/electron.profile
+++ b/etc/profile-a-l/electron.profile
@@ -22,8 +22,8 @@ include whitelist-runuser-common.inc
22include whitelist-usr-share-common.inc 22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc 23include whitelist-var-common.inc
24 24
25# Add the next line to your chromium-common.local if your kernel allows unprivileged userns clone. 25# Add the next line to your electron.local if your kernel allows unprivileged userns clone.
26#include chromium-common-hardened.inc.profile 26#include electron-hardened.inc.profile
27 27
28apparmor 28apparmor
29caps.keep sys_admin,sys_chroot 29caps.keep sys_admin,sys_chroot
diff --git a/etc/profile-a-l/firefox-common.profile b/etc/profile-a-l/firefox-common.profile
index 13313cb67..60d64736e 100644
--- a/etc/profile-a-l/firefox-common.profile
+++ b/etc/profile-a-l/firefox-common.profile
@@ -35,6 +35,8 @@ include whitelist-runuser-common.inc
35include whitelist-var-common.inc 35include whitelist-var-common.inc
36 36
37apparmor 37apparmor
38# Fixme!
39apparmor-replace
38caps.drop all 40caps.drop all
39# machine-id breaks pulse audio; add it to your firefox-common.local if sound is not required. 41# machine-id breaks pulse audio; add it to your firefox-common.local if sound is not required.
40#machine-id 42#machine-id
diff --git a/etc/profile-m-z/sylpheed.profile b/etc/profile-m-z/sylpheed.profile
index 328812b04..483ff39a8 100644
--- a/etc/profile-m-z/sylpheed.profile
+++ b/etc/profile-m-z/sylpheed.profile
@@ -17,10 +17,11 @@ whitelist /usr/share/sylpheed
17 17
18dbus-user filter 18dbus-user filter
19dbus-user.talk ca.desrt.dconf 19dbus-user.talk ca.desrt.dconf
20dbus-user.talk org.freedesktop.secrets
21dbus-user.talk org.gnome.keyring.SystemPrompter
22# Add the next line to your sylpheed.local to enable notifications. 20# Add the next line to your sylpheed.local to enable notifications.
23# dbus-user.talk org.freedesktop.Notifications 21# dbus-user.talk org.freedesktop.Notifications
22dbus-user.talk org.freedesktop.secrets
23dbus-user.talk org.gnome.keyring.SystemPrompter
24dbus-user.talk org.mozilla.*
24 25
25# Redirect 26# Redirect
26include email-common.profile 27include email-common.profile
diff --git a/etc/profile-m-z/ytmdesktop.profile b/etc/profile-m-z/ytmdesktop.profile
index 59b6e2543..aa466871c 100644
--- a/etc/profile-m-z/ytmdesktop.profile
+++ b/etc/profile-m-z/ytmdesktop.profile
@@ -1,5 +1,5 @@
1# Firejail profile for ytmdesktop 1# Firejail profile for ytmdesktop
2# Description: Unofficial electron based desktop warpper for YouTube Music 2# Description: Unofficial electron based desktop wrapper for YouTube Music
3# This file is overwritten after every install/update 3# This file is overwritten after every install/update
4# Persistent local customizations 4# Persistent local customizations
5include youtube.local 5include youtube.local
diff --git a/src/firecfg/firecfg.config b/src/firecfg/firecfg.config
index 788c150be..793ec9a52 100644
--- a/src/firecfg/firecfg.config
+++ b/src/firecfg/firecfg.config
@@ -130,6 +130,7 @@ catfish
130cawbird 130cawbird
131celluloid 131celluloid
132chafa 132chafa
133chatterino
133checkbashisms 134checkbashisms
134cheese 135cheese
135cherrytree 136cherrytree
diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h
index 776649131..4fe3a5974 100644
--- a/src/firejail/firejail.h
+++ b/src/firejail/firejail.h
@@ -339,6 +339,7 @@ extern int arg_writable_var_log; // writable /var/log
339extern int arg_appimage; // appimage 339extern int arg_appimage; // appimage
340extern int arg_apparmor; // apparmor 340extern int arg_apparmor; // apparmor
341extern char *apparmor_profile; // apparmor profile 341extern char *apparmor_profile; // apparmor profile
342extern bool apparmor_replace; // whether apparmor should replace the profile (legacy behavior)
342extern int arg_allow_debuggers; // allow debuggers 343extern int arg_allow_debuggers; // allow debuggers
343extern int arg_x11_block; // block X11 344extern int arg_x11_block; // block X11
344extern int arg_x11_xorg; // use X11 security extension 345extern int arg_x11_xorg; // use X11 security extension
diff --git a/src/firejail/main.c b/src/firejail/main.c
index c95964503..18e9ae651 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -134,6 +134,7 @@ int arg_writable_var_log = 0; // writable /var/log
134int arg_appimage = 0; // appimage 134int arg_appimage = 0; // appimage
135int arg_apparmor = 0; // apparmor 135int arg_apparmor = 0; // apparmor
136char *apparmor_profile = NULL; // apparmor profile 136char *apparmor_profile = NULL; // apparmor profile
137bool apparmor_replace = false; // apparmor profile
137int arg_allow_debuggers = 0; // allow debuggers 138int arg_allow_debuggers = 0; // allow debuggers
138int arg_x11_block = 0; // block X11 139int arg_x11_block = 0; // block X11
139int arg_x11_xorg = 0; // use X11 security extension 140int arg_x11_xorg = 0; // use X11 security extension
@@ -1383,6 +1384,10 @@ int main(int argc, char **argv, char **envp) {
1383 arg_apparmor = 1; 1384 arg_apparmor = 1;
1384 apparmor_profile = argv[i] + 11; 1385 apparmor_profile = argv[i] + 11;
1385 } 1386 }
1387 else if (strncmp(argv[i], "--apparmor-replace", 18) == 0) {
1388 arg_apparmor = 1;
1389 apparmor_replace = true;
1390 }
1386#endif 1391#endif
1387 else if (strncmp(argv[i], "--protocol=", 11) == 0) { 1392 else if (strncmp(argv[i], "--protocol=", 11) == 0) {
1388 if (checkcfg(CFG_SECCOMP)) { 1393 if (checkcfg(CFG_SECCOMP)) {
diff --git a/src/firejail/profile.c b/src/firejail/profile.c
index 4e6ebdbca..acf206da6 100644
--- a/src/firejail/profile.c
+++ b/src/firejail/profile.c
@@ -966,6 +966,22 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
966 return 0; 966 return 0;
967 } 967 }
968 968
969 if (strcmp(ptr, "apparmor-replace") == 0) {
970#ifdef HAVE_APPARMOR
971 arg_apparmor = 1;
972 apparmor_replace = true;
973#endif
974 return 0;
975 }
976
977 if (strcmp(ptr, "apparmor-stack") == 0) {
978#ifdef HAVE_APPARMOR
979 arg_apparmor = 1;
980 apparmor_replace = false;
981#endif
982 return 0;
983 }
984
969 if (strncmp(ptr, "protocol ", 9) == 0) { 985 if (strncmp(ptr, "protocol ", 9) == 0) {
970 if (checkcfg(CFG_SECCOMP)) { 986 if (checkcfg(CFG_SECCOMP)) {
971 const char *add = ptr + 9; 987 const char *add = ptr + 9;
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c
index bae189a0d..77fe73174 100644
--- a/src/firejail/sandbox.c
+++ b/src/firejail/sandbox.c
@@ -130,7 +130,14 @@ static void set_caps(void) {
130static void set_apparmor(void) { 130static void set_apparmor(void) {
131 EUID_ASSERT(); 131 EUID_ASSERT();
132 if (checkcfg(CFG_APPARMOR) && arg_apparmor) { 132 if (checkcfg(CFG_APPARMOR) && arg_apparmor) {
133 if (aa_stack_onexec(apparmor_profile)) { 133 int res = 0;
134 if(apparmor_replace){
135 fwarning("Replacing profile instead of stacking it. It is a legacy behavior that can result in relaxation of the protection. It is here as a temporary measure to unbreak the software that has been broken by switching to the stacking behavior.\n");
136 res = aa_change_onexec(apparmor_profile);
137 } else {
138 res = aa_stack_onexec(apparmor_profile);
139 }
140 if (res) {
134 fwarning("Cannot confine the application using AppArmor.\n" 141 fwarning("Cannot confine the application using AppArmor.\n"
135 "Maybe firejail-default AppArmor profile is not loaded into the kernel.\n" 142 "Maybe firejail-default AppArmor profile is not loaded into the kernel.\n"
136 "As root, run \"aa-enforce firejail-default\" to load it.\n"); 143 "As root, run \"aa-enforce firejail-default\" to load it.\n");