aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build.yml6
-rw-r--r--README1
-rw-r--r--README.md44
-rw-r--r--RELNOTES3
-rw-r--r--etc/profile-a-l/evolution.profile60
-rw-r--r--etc/profile-a-l/kmail.profile81
-rw-r--r--src/firejail/fs.c8
-rw-r--r--src/firejail/profile.c21
8 files changed, 188 insertions, 36 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 214f39923..71cb7f0b4 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -47,3 +47,9 @@ jobs:
47 run: sudo apt-get install cppcheck 47 run: sudo apt-get install cppcheck
48 - name: cppcheck 48 - name: cppcheck
49 run: cppcheck -q --force --error-exitcode=1 --enable=warning,performance . 49 run: cppcheck -q --force --error-exitcode=1 --enable=warning,performance .
50 profile-sort:
51 runs-on: ubuntu-20.04
52 steps:
53 - uses: actions/checkout@v2
54 - name: check profiles
55 run: ./contrib/sort.py etc/*/{*.inc,*.net,*.profile}
diff --git a/README b/README
index 330e2c60d..9bb98b2bf 100644
--- a/README
+++ b/README
@@ -525,6 +525,7 @@ KOLANICH (https://github.com/KOLANICH)
525 - fix meld 525 - fix meld
526kortewegdevries (https://github.com/kortewegdevries) 526kortewegdevries (https://github.com/kortewegdevries)
527 - a whole bunch of new profiles and fixes 527 - a whole bunch of new profiles and fixes
528 - whitelisting evolution, kmail
528Kristóf Marussy (https://github.com/kris7t) 529Kristóf Marussy (https://github.com/kris7t)
529 - dns support 530 - dns support
530Kunal Mehta (https://github.com/legoktm) 531Kunal Mehta (https://github.com/legoktm)
diff --git a/README.md b/README.md
index 6bc24cfbb..5259bb1b1 100644
--- a/README.md
+++ b/README.md
@@ -158,36 +158,42 @@ We also keep a list of profile fixes for previous released versions in [etc-fixe
158 158
159## Current development version: 0.9.65 159## Current development version: 0.9.65
160 160
161Milestone page: https://github.com/netblue30/firejail/milestone/1
162Release discussion: https://github.com/netblue30/firejail/issues/3696
163
164
165
161### Profile Statistics 166### Profile Statistics
162 167
163A small tool to print profile statistics. Compile as usual and run in /etc/profiles: 168A small tool to print profile statistics. Compile as usual and run in /etc/profiles:
164````` 169`````
170$ sudo cp src/prfostats/profstats /etc/firejail/.
171$ cd /etc/firejail
165$ ./profstats *.profile 172$ ./profstats *.profile
166Warning: multiple caps in transmission-daemon.profile 173Warning: multiple caps in transmission-daemon.profile
167 174
168Stats: 175Stats:
169 profiles 1029 176 profiles 1031
170 include local profile 1029 (include profile-name.local) 177 include local profile 1031 (include profile-name.local)
171 include globals 1029 (include globals.local) 178 include globals 1031 (include globals.local)
172 blacklist ~/.ssh 1005 (include disable-common.inc) 179 blacklist ~/.ssh 1007 (include disable-common.inc)
173 seccomp 975 180 seccomp 976
174 capabilities 1028 181 capabilities 1030
175 noexec 899 (include disable-exec.inc) 182 noexec 901 (include disable-exec.inc)
176 memory-deny-write-execute 220 183 memory-deny-write-execute 221
177 apparmor 549 184 apparmor 555
178 private-bin 542 185 private-bin 544
179 private-dev 897 186 private-dev 897
180 private-etc 431 187 private-etc 435
181 private-tmp 784 188 private-tmp 785
182 whitelist home directory 469 189 whitelist home directory 474
183 whitelist var 695 (include whitelist-var-common.inc) 190 whitelist var 699 (include whitelist-var-common.inc)
184 whitelist run/user 334 (include whitelist-runuser-common.inc 191 whitelist run/user 336 (include whitelist-runuser-common.inc
185 or blacklist ${RUNUSER}) 192 or blacklist ${RUNUSER})
186 whitelist usr/share 354 (include whitelist-usr-share-common.inc 193 whitelist usr/share 359 (include whitelist-usr-share-common.inc
187 net none 332 194 net none 333
188 dbus-user none 523 195 dbus-user none 523
189 dbus-system none 627 196 dbus-system none 632
190`````
191 197
192### New profiles: 198### New profiles:
193 199
diff --git a/RELNOTES b/RELNOTES
index f38b42c4b..d9036898f 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -1,3 +1,6 @@
1firejail (0.9.65) baseline; urgency=low
2 * allow --tmpfs inside $HOME for unprivileged users
3
1firejail (0.9.64) baseline; urgency=low 4firejail (0.9.64) baseline; urgency=low
2 * replaced --nowrap option with --wrap in firemon 5 * replaced --nowrap option with --wrap in firemon
3 * The blocking action of seccomp filters has been changed from 6 * The blocking action of seccomp filters has been changed from
diff --git a/etc/profile-a-l/evolution.profile b/etc/profile-a-l/evolution.profile
index 422200ffe..1355c4337 100644
--- a/etc/profile-a-l/evolution.profile
+++ b/etc/profile-a-l/evolution.profile
@@ -6,15 +6,16 @@ include evolution.local
6# Persistent global definitions 6# Persistent global definitions
7include globals.local 7include globals.local
8 8
9noblacklist /var/mail
10noblacklist /var/spool/mail
11noblacklist ${HOME}/.bogofilter 9noblacklist ${HOME}/.bogofilter
10noblacklist ${HOME}/.gnupg
11noblacklist ${HOME}/.mozilla
12noblacklist ${HOME}/.pki
12noblacklist ${HOME}/.cache/evolution 13noblacklist ${HOME}/.cache/evolution
13noblacklist ${HOME}/.config/evolution 14noblacklist ${HOME}/.config/evolution
14noblacklist ${HOME}/.gnupg
15noblacklist ${HOME}/.local/share/evolution 15noblacklist ${HOME}/.local/share/evolution
16noblacklist ${HOME}/.pki
17noblacklist ${HOME}/.local/share/pki 16noblacklist ${HOME}/.local/share/pki
17noblacklist /var/mail
18noblacklist /var/spool/mail
18 19
19include disable-common.inc 20include disable-common.inc
20include disable-devel.inc 21include disable-devel.inc
@@ -22,13 +23,42 @@ include disable-exec.inc
22include disable-interpreters.inc 23include disable-interpreters.inc
23include disable-passwdmgr.inc 24include disable-passwdmgr.inc
24include disable-programs.inc 25include disable-programs.inc
26include disable-shell.inc
27include disable-xdg.inc
25 28
29mkdir ${HOME}/.bogofilter
30mkdir ${HOME}/.gnupg
31mkdir ${HOME}/.pki
32mkdir ${HOME}/.cache/evolution
33mkdir ${HOME}/.config/evolution
34mkdir ${HOME}/.local/share/evolution
35mkdir ${HOME}/.local/share/pki
36whitelist ${HOME}/.bogofilter
37whitelist ${HOME}/.gnupg
38whitelist ${HOME}/.mozilla/firefox/profiles.ini
39whitelist ${HOME}/.pki
40whitelist ${HOME}/.cache/evolution
41whitelist ${HOME}/.config/evolution
42whitelist ${HOME}/.local/share/evolution
43whitelist ${HOME}/.local/share/pki
44whitelist ${DOCUMENTS}
45whitelist ${DOWNLOADS}
46whitelist ${RUNUSER}/gnupg
47whitelist /usr/share/evolution
48whitelist /usr/share/gnupg
49whitelist /usr/share/gnupg2
50whitelist /var/mail
51whitelist /var/spool/mail
52include whitelist-common.inc
26include whitelist-runuser-common.inc 53include whitelist-runuser-common.inc
54include whitelist-usr-share-common.inc
55include whitelist-var-common.inc
27 56
57apparmor
28caps.drop all 58caps.drop all
29netfilter 59netfilter
30# no3d breaks under wayland 60# no3d breaks under wayland
31#no3d 61# no3d
32nodvd 62nodvd
33nogroups 63nogroups
34nonewprivs 64nonewprivs
@@ -40,7 +70,27 @@ novideo
40protocol unix,inet,inet6 70protocol unix,inet,inet6
41seccomp 71seccomp
42shell none 72shell none
73tracelog
43 74
75# disable-mnt
76# Add "gpg,gpg2,gpg-agent,pinentry-curses,pinentry-emacs,pinentry-fltk,pinentry-gnome3,pinentry-gtk,pinentry-gtk2,pinentry-gtk-2,pinentry-qt,pinentry-qt4,pinentry-tty,pinentry-x2go,pinentry-kwallet" for gpg
77# To use private-bin add all evolution,gpg,pinentry binaries and follow firefox.profile for hyperlink support
78# private-bin evolution
79private-cache
44private-dev 80private-dev
81private-etc alternatives,ca-certificates,crypto-policies,dconf,fonts,gcrypt,groups,gtk-2.0,gtk-3.0,hostname,hosts,mailname,passwd,pki,resolv.conf,selinux,ssl,xdg
45private-tmp 82private-tmp
83writable-run-user
46writable-var 84writable-var
85
86dbus-user filter
87dbus-user.own org.gnome.Evolution
88dbus-user.talk ca.desrt.dconf
89# Uncomment to have keyring access
90# dbus-user.talk org.freedesktop.secrets
91dbus-user.talk org.gnome.keyring.SystemPrompter
92dbus-user.talk org.gnome.OnlineAccounts
93dbus-user.talk org.freedesktop.Notifications
94dbus-system none
95
96read-only ${HOME}/.mozilla/firefox/profiles.ini
diff --git a/etc/profile-a-l/kmail.profile b/etc/profile-a-l/kmail.profile
index ab4ff10b9..8d99da3cf 100644
--- a/etc/profile-a-l/kmail.profile
+++ b/etc/profile-a-l/kmail.profile
@@ -9,6 +9,10 @@ include globals.local
9# kmail has problems launching akonadi in debian and ubuntu. 9# kmail has problems launching akonadi in debian and ubuntu.
10# one solution is to have akonadi already running when kmail is started 10# one solution is to have akonadi already running when kmail is started
11 11
12noblacklist ${HOME}/.gnupg
13# noblacklist ${HOME}/.kde/
14# noblacklist ${HOME}/.kde4/
15noblacklist ${HOME}/.mozilla
12noblacklist ${HOME}/.cache/akonadi* 16noblacklist ${HOME}/.cache/akonadi*
13noblacklist ${HOME}/.cache/kmail2 17noblacklist ${HOME}/.cache/kmail2
14noblacklist ${HOME}/.config/akonadi* 18noblacklist ${HOME}/.config/akonadi*
@@ -19,7 +23,6 @@ noblacklist ${HOME}/.config/kmail2rc
19noblacklist ${HOME}/.config/kmailsearchindexingrc 23noblacklist ${HOME}/.config/kmailsearchindexingrc
20noblacklist ${HOME}/.config/mailtransports 24noblacklist ${HOME}/.config/mailtransports
21noblacklist ${HOME}/.config/specialmailcollectionsrc 25noblacklist ${HOME}/.config/specialmailcollectionsrc
22noblacklist ${HOME}/.gnupg
23noblacklist ${HOME}/.local/share/akonadi* 26noblacklist ${HOME}/.local/share/akonadi*
24noblacklist ${HOME}/.local/share/apps/korganizer 27noblacklist ${HOME}/.local/share/apps/korganizer
25noblacklist ${HOME}/.local/share/contacts 28noblacklist ${HOME}/.local/share/contacts
@@ -30,6 +33,8 @@ noblacklist ${HOME}/.local/share/kxmlgui5/kmail2
30noblacklist ${HOME}/.local/share/local-mail 33noblacklist ${HOME}/.local/share/local-mail
31noblacklist ${HOME}/.local/share/notes 34noblacklist ${HOME}/.local/share/notes
32noblacklist /tmp/akonadi-* 35noblacklist /tmp/akonadi-*
36noblacklist /var/mail
37noblacklist /var/spool/mail
33 38
34include disable-common.inc 39include disable-common.inc
35include disable-devel.inc 40include disable-devel.inc
@@ -37,10 +42,73 @@ include disable-exec.inc
37include disable-interpreters.inc 42include disable-interpreters.inc
38include disable-passwdmgr.inc 43include disable-passwdmgr.inc
39include disable-programs.inc 44include disable-programs.inc
45include disable-xdg.inc
40 46
47mkdir ${HOME}/.gnupg
48# mkdir ${HOME}/.kde/
49# mkdir ${HOME}/.kde4/
50mkdir ${HOME}/.cache/akonadi*
51mkdir ${HOME}/.cache/kmail2
52mkdir ${HOME}/.config/akonadi*
53mkdir ${HOME}/.config/baloorc
54mkdir ${HOME}/.config/emaildefaults
55mkdir ${HOME}/.config/emailidentities
56mkdir ${HOME}/.config/kmail2rc
57mkdir ${HOME}/.config/kmailsearchindexingrc
58mkdir ${HOME}/.config/mailtransports
59mkdir ${HOME}/.config/specialmailcollectionsrc
60mkdir ${HOME}/.local/share/akonadi*
61mkdir ${HOME}/.local/share/apps/korganizer
62mkdir ${HOME}/.local/share/contacts
63mkdir ${HOME}/.local/share/emailidentities
64mkdir ${HOME}/.local/share/kmail2
65mkdir ${HOME}/.local/share/kxmlgui5/kmail
66mkdir ${HOME}/.local/share/kxmlgui5/kmail2
67mkdir ${HOME}/.local/share/local-mail
68mkdir ${HOME}/.local/share/notes
69mkdir /tmp/akonadi-*
70whitelist ${HOME}/.gnupg
71# whitelist ${HOME}/.kde/
72# whitelist ${HOME}/.kde4/
73whitelist ${HOME}/.mozilla/firefox/profiles.ini
74whitelist ${HOME}/.cache/akonadi*
75whitelist ${HOME}/.cache/kmail2
76whitelist ${HOME}/.config/akonadi*
77whitelist ${HOME}/.config/baloorc
78whitelist ${HOME}/.config/emaildefaults
79whitelist ${HOME}/.config/emailidentities
80whitelist ${HOME}/.config/kmail2rc
81whitelist ${HOME}/.config/kmailsearchindexingrc
82whitelist ${HOME}/.config/mailtransports
83whitelist ${HOME}/.config/specialmailcollectionsrc
84whitelist ${HOME}/.local/share/akonadi*
85whitelist ${HOME}/.local/share/apps/korganizer
86whitelist ${HOME}/.local/share/contacts
87whitelist ${HOME}/.local/share/emailidentities
88whitelist ${HOME}/.local/share/kmail2
89whitelist ${HOME}/.local/share/kxmlgui5/kmail
90whitelist ${HOME}/.local/share/kxmlgui5/kmail2
91whitelist ${HOME}/.local/share/local-mail
92whitelist ${HOME}/.local/share/notes
93whitelist ${DOWNLOADS}
94whitelist ${DOCUMENTS}
95whitelist ${RUNUSER}/gnupg
96whitelist /tmp/akonadi-*
97whitelist /usr/share/akonadi
98whitelist /usr/share/gnupg
99whitelist /usr/share/gnupg2
100whitelist /usr/share/kconf_update
101whitelist /usr/share/kf5
102whitelist /usr/share/kservices5
103whitelist /usr/share/qlogging-categories5
104whitelist /var/mail
105whitelist /var/spool/mail
106include whitelist-common.inc
107include whitelist-runuser-common.inc
108include whitelist-usr-share-common.inc
41include whitelist-var-common.inc 109include whitelist-var-common.inc
42 110
43# apparmor 111apparmor
44caps.drop all 112caps.drop all
45netfilter 113netfilter
46nodvd 114nodvd
@@ -56,7 +124,14 @@ protocol unix,inet,inet6,netlink
56seccomp !chroot,!io_getevents,!io_setup,!io_submit,!ioprio_set 124seccomp !chroot,!io_getevents,!io_setup,!io_submit,!ioprio_set
57# tracelog 125# tracelog
58 126
127private-cache
59private-dev 128private-dev
129private-etc alternatives,ca-certificates,crypto-policies,dconf,drirc,fonts,gcrypt,groups,gtk-2.0,gtk-3.0,hostname,hosts,ld.so.cache,ld.so.preload,mailname,nsswitch.conf,passwd,pki,resolv.conf,selinux,ssl,xdg
60# private-tmp - interrupts connection to akonadi, breaks opening of email attachments 130# private-tmp - interrupts connection to akonadi, breaks opening of email attachments
61# writable-run-user is needed for signing and encrypting emails
62writable-run-user 131writable-run-user
132writable-var
133
134# dbus-user none
135dbus-system none
136
137read-only ${HOME}/.mozilla/firefox/profiles.ini \ No newline at end of file
diff --git a/src/firejail/fs.c b/src/firejail/fs.c
index 2000ffc62..2f2bfdc79 100644
--- a/src/firejail/fs.c
+++ b/src/firejail/fs.c
@@ -366,6 +366,14 @@ void fs_blacklist(void) {
366 else if (strncmp(entry->data, "tmpfs ", 6) == 0) { 366 else if (strncmp(entry->data, "tmpfs ", 6) == 0) {
367 ptr = entry->data + 6; 367 ptr = entry->data + 6;
368 op = MOUNT_TMPFS; 368 op = MOUNT_TMPFS;
369 char *resolved_path = realpath(ptr, NULL);
370 if (!resolved_path || strncmp(cfg.homedir, resolved_path, strlen(cfg.homedir)) != 0) {
371 if (getuid() != 0) {
372 fprintf(stderr, "Error: tmpfs outside $HOME is only available for root\n");
373 exit(1);
374 }
375 }
376 free(resolved_path);
369 } 377 }
370 else if (strncmp(entry->data, "mkdir ", 6) == 0) { 378 else if (strncmp(entry->data, "mkdir ", 6) == 0) {
371 EUID_USER(); 379 EUID_USER();
diff --git a/src/firejail/profile.c b/src/firejail/profile.c
index 5d83e6a73..869183e2f 100644
--- a/src/firejail/profile.c
+++ b/src/firejail/profile.c
@@ -1412,11 +1412,6 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
1412 // filesystem bind 1412 // filesystem bind
1413 if (strncmp(ptr, "bind ", 5) == 0) { 1413 if (strncmp(ptr, "bind ", 5) == 0) {
1414 if (checkcfg(CFG_BIND)) { 1414 if (checkcfg(CFG_BIND)) {
1415 if (getuid() != 0) {
1416 fprintf(stderr, "Error: --bind option is available only if running as root\n");
1417 exit(1);
1418 }
1419
1420 // extract two directories 1415 // extract two directories
1421 char *dname1 = ptr + 5; 1416 char *dname1 = ptr + 5;
1422 char *dname2 = split_comma(dname1); // this inserts a '0 to separate the two dierctories 1417 char *dname2 = split_comma(dname1); // this inserts a '0 to separate the two dierctories
@@ -1432,6 +1427,18 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
1432 fprintf(stderr, "Error: invalid file name.\n"); 1427 fprintf(stderr, "Error: invalid file name.\n");
1433 exit(1); 1428 exit(1);
1434 } 1429 }
1430 if (getuid() != 0) {
1431 char *resolved_path1 = realpath(dname1, NULL);
1432 char *resolved_path2 = realpath(dname2, NULL);
1433 assert(resolved_path1 && resolved_path2);
1434 if (strncmp(cfg.homedir, resolved_path1, strlen(cfg.homedir)) != 0
1435 || strncmp(cfg.homedir, resolved_path2, strlen(cfg.homedir)) != 0) {
1436 fprintf(stderr, "Error: bind outside $HOME is only available for root\n");
1437 exit(1);
1438 }
1439 free(resolved_path1);
1440 free(resolved_path2);
1441 }
1435 if (is_link(dname1) || is_link(dname2)) { 1442 if (is_link(dname1) || is_link(dname2)) {
1436 fprintf(stderr, "Symbolic links are not allowed for bind command\n"); 1443 fprintf(stderr, "Symbolic links are not allowed for bind command\n");
1437 exit(1); 1444 exit(1);
@@ -1563,10 +1570,6 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
1563 else if (strncmp(ptr, "noexec ", 7) == 0) 1570 else if (strncmp(ptr, "noexec ", 7) == 0)
1564 ptr += 7; 1571 ptr += 7;
1565 else if (strncmp(ptr, "tmpfs ", 6) == 0) { 1572 else if (strncmp(ptr, "tmpfs ", 6) == 0) {
1566 if (getuid() != 0) {
1567 fprintf(stderr, "Error: tmpfs available only when running the sandbox as root\n");
1568 exit(1);
1569 }
1570 ptr += 6; 1573 ptr += 6;
1571 } 1574 }
1572 else { 1575 else {