aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README3
-rw-r--r--README.md14
-rw-r--r--RELNOTES3
-rw-r--r--etc/disable-common.inc3
-rw-r--r--etc/disable-programs.inc4
-rw-r--r--etc/gajim.profile33
-rw-r--r--etc/gnome-mplayer.profile5
-rw-r--r--etc/gpredict.profile3
-rw-r--r--etc/gthumb.profile3
-rw-r--r--etc/hedgewars.profile6
-rw-r--r--etc/hexchat.profile6
-rw-r--r--etc/icecat.profile51
-rw-r--r--etc/jitsi.profile1
-rw-r--r--etc/kmail.profile4
-rw-r--r--etc/konversation.profile3
-rw-r--r--etc/slack.profile27
-rw-r--r--etc/spotify.profile2
-rw-r--r--etc/whitelist-common.inc3
-rw-r--r--platform/debian/conffiles1
-rw-r--r--src/include/common.h1
-rw-r--r--src/lib/common.c60
-rw-r--r--src/lib/pid.c16
22 files changed, 220 insertions, 32 deletions
diff --git a/README b/README
index f27a80a34..13c324a02 100644
--- a/README
+++ b/README
@@ -43,6 +43,9 @@ hamzadis (https://github.com/hamzadis)
43 - added --overlay-named=name and --overlay-path=path 43 - added --overlay-named=name and --overlay-path=path
44Gaman Gabriel (https://github.com/stelariusinfinitek) 44Gaman Gabriel (https://github.com/stelariusinfinitek)
45 - inox profile 45 - inox profile
46greigdp (https://github.com/greigdp)
47 - fixed spotify profile
48 - added Slack profile
46Laurent Declercq (https://github.com/nuxwin) 49Laurent Declercq (https://github.com/nuxwin)
47 - fixed test for shell interpreter in chroots 50 - fixed test for shell interpreter in chroots
48Franco (nextime) Lanza (https://github.com/nextime) 51Franco (nextime) Lanza (https://github.com/nextime)
diff --git a/README.md b/README.md
index 04965a97a..13aeb51b0 100644
--- a/README.md
+++ b/README.md
@@ -57,19 +57,7 @@ TESTING: file
57TESTING: tar 57TESTING: tar
58netblue@debian:~/work/github/firejail/test/sysutils$ TESTING ERROR 3.1 58netblue@debian:~/work/github/firejail/test/sysutils$ TESTING ERROR 3.1
59[...] 59[...]
60cd test/apps-x11; ./apps-x11.sh | grep TESTING
61TESTING: xterm x11
62netblue@debian:~/work/github/firejail/test/apps-x11$ TESTING ERROR 5.1
63TESTING: firefox x11
64netblue@debian:~/work/github/firejail/test/apps-x11$ TESTING ERROR 5.1
65TESTING: chromium x11
66TESTING: transmission-gtk x11
67netblue@debian:~/work/github/firejail/test/apps-x11$ TESTING ERROR 5.1
68TESTING: icedove x11
69netblue@debian:~/work/github/firejail/test/apps-x11$ TESTING ERROR 5.1
70[...]
71````` 60`````
72"firemon --seccomp" and "firemon --caps" are misbehaving at the moment.
73 61
74## Deprecated --user 62## Deprecated --user
75 63
@@ -230,5 +218,5 @@ Browsers: Palemoon
230## New security profiles 218## New security profiles
231 219
232Gitter, gThumb, mpv, Franz messenger, LibreOffice, pix, audacity, xz, xzdec, gzip, cpio, less, Atom Beta, Atom, jitsi, eom, uudeview 220Gitter, gThumb, mpv, Franz messenger, LibreOffice, pix, audacity, xz, xzdec, gzip, cpio, less, Atom Beta, Atom, jitsi, eom, uudeview
233tar (gtar), unzip, unrar, file, skypeforlinux, gnome-chess, inox 221tar (gtar), unzip, unrar, file, skypeforlinux, gnome-chess, inox, Slack
234 222
diff --git a/RELNOTES b/RELNOTES
index 4e2ad9b6c..eec3117ed 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -25,7 +25,8 @@ firejail (0.9.42~rc2) baseline; urgency=low
25 * new profiles: Gitter, gThumb, mpv, Franz messenger, LibreOffice 25 * new profiles: Gitter, gThumb, mpv, Franz messenger, LibreOffice
26 * new profiles: pix, audacity, xz, xzdec, gzip, cpio, less 26 * new profiles: pix, audacity, xz, xzdec, gzip, cpio, less
27 * new profiles: Atom Beta, Atom, jitsi, eom, uudeview 27 * new profiles: Atom Beta, Atom, jitsi, eom, uudeview
28 * new profiles: tar (gtar), unzip, unrar, file, skypeforlinux, inox 28 * new profiles: tar (gtar), unzip, unrar, file, skypeforlinux,
29 * new profiles: inox, Slack, gnome-chess
29 -- netblue30 <netblue30@yahoo.com> Thu, 21 Jul 2016 08:00:00 -0500 30 -- netblue30 <netblue30@yahoo.com> Thu, 21 Jul 2016 08:00:00 -0500
30 31
31firejail (0.9.40) baseline; urgency=low 32firejail (0.9.40) baseline; urgency=low
diff --git a/etc/disable-common.inc b/etc/disable-common.inc
index d18ee0287..ed6ee315b 100644
--- a/etc/disable-common.inc
+++ b/etc/disable-common.inc
@@ -14,6 +14,7 @@ blacklist /etc/xdg/autostart
14blacklist ${HOME}/.kde4/Autostart 14blacklist ${HOME}/.kde4/Autostart
15blacklist ${HOME}/.kde4/share/autostart 15blacklist ${HOME}/.kde4/share/autostart
16blacklist ${HOME}/.kde/Autostart 16blacklist ${HOME}/.kde/Autostart
17blacklist ${HOME}/.kde/share/autostart
17blacklist ${HOME}/.config/plasma-workspace/shutdown 18blacklist ${HOME}/.config/plasma-workspace/shutdown
18blacklist ${HOME}/.config/plasma-workspace/env 19blacklist ${HOME}/.config/plasma-workspace/env
19blacklist ${HOME}/.config/lxsession/LXDE/autostart 20blacklist ${HOME}/.config/lxsession/LXDE/autostart
@@ -168,3 +169,5 @@ blacklist ${PATH}/roxterm-config
168blacklist ${PATH}/terminix 169blacklist ${PATH}/terminix
169blacklist ${PATH}/urxvtc 170blacklist ${PATH}/urxvtc
170blacklist ${PATH}/urxvtcd 171blacklist ${PATH}/urxvtcd
172blacklist ${PATH}/konsole
173blacklist ${PATH}/yakuake
diff --git a/etc/disable-programs.inc b/etc/disable-programs.inc
index 140417b01..26d9cf22b 100644
--- a/etc/disable-programs.inc
+++ b/etc/disable-programs.inc
@@ -78,6 +78,10 @@ blacklist ${HOME}/.TelegramDesktop
78blacklist ${HOME}/.config/Gitter 78blacklist ${HOME}/.config/Gitter
79blacklist ${HOME}/.config/Franz 79blacklist ${HOME}/.config/Franz
80blacklist ${HOME}/.jitsi 80blacklist ${HOME}/.jitsi
81blacklist ${HOME}/.config/Slack
82blacklist ${HOME}/.cache/gajim
83blacklist ${HOME}/.local/share/gajim
84blacklist ${HOME}/.config/gajim
81 85
82# Games 86# Games
83blacklist ${HOME}/.hedgewars 87blacklist ${HOME}/.hedgewars
diff --git a/etc/gajim.profile b/etc/gajim.profile
new file mode 100644
index 000000000..04902a734
--- /dev/null
+++ b/etc/gajim.profile
@@ -0,0 +1,33 @@
1# Firejail profile for Gajim
2
3mkdir ${HOME}/.cache/gajim
4mkdir ${HOME}/.local/share/gajim
5mkdir ${HOME}/.config/gajim
6mkdir ${HOME}/Downloads
7
8# Allow the local python 2.7 site packages, in case any plugins are using these
9mkdir ${HOME}/.local/lib/python2.7/site-packages/
10whitelist ${HOME}/.local/lib/python2.7/site-packages/
11read-only ${HOME}/.local/lib/python2.7/site-packages/
12
13whitelist ${HOME}/.cache/gajim
14whitelist ${HOME}/.local/share/gajim
15whitelist ${HOME}/.config/gajim
16whitelist ${HOME}/Downloads
17
18include /etc/firejail/disable-common.inc
19include /etc/firejail/disable-passwdmgr.inc
20include /etc/firejail/disable-programs.inc
21include /etc/firejail/disable-devel.inc
22
23caps.drop all
24netfilter
25nonewprivs
26nogroups
27noroot
28protocol unix,inet,inet6
29seccomp
30shell none
31
32#private-bin python2.7 gajim
33private-dev
diff --git a/etc/gnome-mplayer.profile b/etc/gnome-mplayer.profile
index 1caea177d..1b0fc9807 100644
--- a/etc/gnome-mplayer.profile
+++ b/etc/gnome-mplayer.profile
@@ -5,10 +5,13 @@ include /etc/firejail/disable-devel.inc
5include /etc/firejail/disable-passwdmgr.inc 5include /etc/firejail/disable-passwdmgr.inc
6 6
7caps.drop all 7caps.drop all
8nogroups
8nonewprivs 9nonewprivs
9noroot 10noroot
10protocol unix,inet,inet6 11protocol unix,inet,inet6
11seccomp 12seccomp
12
13shell none 13shell none
14
14private-bin gnome-mplayer 15private-bin gnome-mplayer
16private-dev
17private-tmp
diff --git a/etc/gpredict.profile b/etc/gpredict.profile
index a8378a66e..353ecceae 100644
--- a/etc/gpredict.profile
+++ b/etc/gpredict.profile
@@ -15,10 +15,11 @@ nonewprivs
15nogroups 15nogroups
16noroot 16noroot
17nosound 17nosound
18protocol unix,inet,inet6,netlink 18protocol unix,inet,inet6
19seccomp 19seccomp
20shell none 20shell none
21tracelog 21tracelog
22 22
23private-bin gpredict 23private-bin gpredict
24private-dev 24private-dev
25private-tmp
diff --git a/etc/gthumb.profile b/etc/gthumb.profile
index 3c02576aa..e043c7229 100644
--- a/etc/gthumb.profile
+++ b/etc/gthumb.profile
@@ -7,8 +7,8 @@ include /etc/firejail/disable-devel.inc
7include /etc/firejail/disable-passwdmgr.inc 7include /etc/firejail/disable-passwdmgr.inc
8 8
9caps.drop all 9caps.drop all
10nonewprivs
11nogroups 10nogroups
11nonewprivs
12noroot 12noroot
13nosound 13nosound
14protocol unix 14protocol unix
@@ -19,3 +19,4 @@ tracelog
19private-bin gthumb 19private-bin gthumb
20whitelist /tmp/.X11-unix 20whitelist /tmp/.X11-unix
21private-dev 21private-dev
22private-tmp
diff --git a/etc/hedgewars.profile b/etc/hedgewars.profile
index c5d863bd5..7910b7eb0 100644
--- a/etc/hedgewars.profile
+++ b/etc/hedgewars.profile
@@ -7,12 +7,16 @@ include /etc/firejail/disable-devel.inc
7include /etc/firejail/disable-passwdmgr.inc 7include /etc/firejail/disable-passwdmgr.inc
8 8
9caps.drop all 9caps.drop all
10netfilter
11nogroups
10nonewprivs 12nonewprivs
11noroot 13noroot
12private-dev
13seccomp 14seccomp
14tracelog 15tracelog
15 16
17private-dev
18private-tmp
19
16mkdir ~/.hedgewars 20mkdir ~/.hedgewars
17whitelist ~/.hedgewars 21whitelist ~/.hedgewars
18include /etc/firejail/whitelist-common.inc 22include /etc/firejail/whitelist-common.inc
diff --git a/etc/hexchat.profile b/etc/hexchat.profile
index 0d7ee6594..0ff64aef5 100644
--- a/etc/hexchat.profile
+++ b/etc/hexchat.profile
@@ -7,9 +7,11 @@ include /etc/firejail/disable-programs.inc
7include /etc/firejail/disable-devel.inc 7include /etc/firejail/disable-devel.inc
8 8
9caps.drop all 9caps.drop all
10netfilter
11nogroups
10nonewprivs 12nonewprivs
11noroot 13noroot
12netfilter 14nosound
13protocol unix,inet,inet6 15protocol unix,inet,inet6
14seccomp 16seccomp
15 17
@@ -18,3 +20,5 @@ whitelist ~/.config/hexchat
18include /etc/firejail/whitelist-common.inc 20include /etc/firejail/whitelist-common.inc
19 21
20# private-bin requires perl, python, etc. 22# private-bin requires perl, python, etc.
23private-dev
24private-tmp
diff --git a/etc/icecat.profile b/etc/icecat.profile
index 25d426ad2..2f8e2df7f 100644
--- a/etc/icecat.profile
+++ b/etc/icecat.profile
@@ -1,2 +1,51 @@
1# Firejail profile for GNU Icecat 1# Firejail profile for GNU Icecat
2include /etc/firejail/firefox.profile 2
3noblacklist ~/.mozilla
4noblacklist ~/.cache/mozilla
5include /etc/firejail/disable-common.inc
6include /etc/firejail/disable-programs.inc
7include /etc/firejail/disable-devel.inc
8
9caps.drop all
10netfilter
11nonewprivs
12noroot
13protocol unix,inet,inet6,netlink
14seccomp
15tracelog
16
17whitelist ${DOWNLOADS}
18mkdir ~/.mozilla
19whitelist ~/.mozilla
20mkdir ~/.cache/mozilla/icecat
21whitelist ~/.cache/mozilla/icecat
22whitelist ~/dwhelper
23whitelist ~/.zotero
24whitelist ~/.vimperatorrc
25whitelist ~/.vimperator
26whitelist ~/.pentadactylrc
27whitelist ~/.pentadactyl
28whitelist ~/.keysnail.js
29whitelist ~/.config/gnome-mplayer
30whitelist ~/.cache/gnome-mplayer/plugin
31whitelist ~/.pki
32
33# lastpass, keepassx
34whitelist ~/.keepassx
35whitelist ~/.config/keepassx
36whitelist ~/keepassx.kdbx
37whitelist ~/.lastpass
38whitelist ~/.config/lastpass
39
40
41#silverlight
42whitelist ~/.wine-pipelight
43whitelist ~/.wine-pipelight64
44whitelist ~/.config/pipelight-widevine
45whitelist ~/.config/pipelight-silverlight5.1
46
47include /etc/firejail/whitelist-common.inc
48
49# experimental features
50#private-etc passwd,group,hostname,hosts,localtime,nsswitch.conf,resolv.conf,gtk-2.0,pango,fonts,iceweasel,firefox,adobe,mime.types,mailcap,asound.conf,pulse
51
diff --git a/etc/jitsi.profile b/etc/jitsi.profile
index 8baf1ad94..c61158f8b 100644
--- a/etc/jitsi.profile
+++ b/etc/jitsi.profile
@@ -14,3 +14,4 @@ seccomp
14shell none 14shell none
15tracelog 15tracelog
16 16
17private-tmp
diff --git a/etc/kmail.profile b/etc/kmail.profile
index 44a53e258..8c8fd18c4 100644
--- a/etc/kmail.profile
+++ b/etc/kmail.profile
@@ -9,7 +9,11 @@ include /etc/firejail/disable-passwdmgr.inc
9caps.drop all 9caps.drop all
10netfilter 10netfilter
11nonewprivs 11nonewprivs
12nogroups
12noroot 13noroot
13protocol unix,inet,inet6,netlink 14protocol unix,inet,inet6,netlink
14seccomp 15seccomp
15tracelog 16tracelog
17
18private-dev
19private-tmp
diff --git a/etc/konversation.profile b/etc/konversation.profile
index 190061618..e9546fd1b 100644
--- a/etc/konversation.profile
+++ b/etc/konversation.profile
@@ -7,6 +7,9 @@ include /etc/firejail/disable-passwdmgr.inc
7 7
8caps.drop all 8caps.drop all
9netfilter 9netfilter
10nogroups
10noroot 11noroot
11seccomp 12seccomp
12protocol unix,inet,inet6 13protocol unix,inet,inet6
14
15private-tmp
diff --git a/etc/slack.profile b/etc/slack.profile
new file mode 100644
index 000000000..ea7b715f9
--- /dev/null
+++ b/etc/slack.profile
@@ -0,0 +1,27 @@
1include /etc/firejail/disable-common.inc
2include /etc/firejail/disable-programs.inc
3include /etc/firejail/disable-devel.inc
4include /etc/firejail/disable-passwdmgr.inc
5
6mkdir ${HOME}/.config
7mkdir ${HOME}/.config/Slack
8whitelist ${HOME}/.config/Slack
9whitelist ~/Downloads
10
11protocol unix,inet,inet6,netlink
12private-dev
13private-tmp
14private-etc fonts,resolv.conf,ld.so.conf,ld.so.cache,localtime
15name slack
16blacklist /var
17
18include /etc/firejail/whitelist-common.inc
19
20caps.drop all
21seccomp
22netfilter
23nonewprivs
24nogroups
25noroot
26shell none
27private-bin slack
diff --git a/etc/spotify.profile b/etc/spotify.profile
index 6bcb99e0f..73d427db3 100644
--- a/etc/spotify.profile
+++ b/etc/spotify.profile
@@ -27,5 +27,5 @@ protocol unix,inet,inet6,netlink
27seccomp 27seccomp
28shell none 28shell none
29 29
30private-bin spotify 30#private-bin spotify
31private-dev 31private-dev
diff --git a/etc/whitelist-common.inc b/etc/whitelist-common.inc
index 2317133c5..abbb4a9fc 100644
--- a/etc/whitelist-common.inc
+++ b/etc/whitelist-common.inc
@@ -20,8 +20,11 @@ whitelist ~/.cache/fontconfig
20# gtk 20# gtk
21whitelist ~/.gtkrc 21whitelist ~/.gtkrc
22whitelist ~/.gtkrc-2.0 22whitelist ~/.gtkrc-2.0
23whitelist ~/.config/gtk-2.0
23whitelist ~/.config/gtk-3.0 24whitelist ~/.config/gtk-3.0
24whitelist ~/.themes 25whitelist ~/.themes
26whitelist ~/.kde/share/config/gtkrc
27whitelist ~/.kde/share/config/gtkrc-2.0
25 28
26# dconf 29# dconf
27mkdir ~/.config/dconf 30mkdir ~/.config/dconf
diff --git a/platform/debian/conffiles b/platform/debian/conffiles
index 59f0b35e7..fb19a135f 100644
--- a/platform/debian/conffiles
+++ b/platform/debian/conffiles
@@ -106,6 +106,7 @@
106/etc/firejail/server.profile 106/etc/firejail/server.profile
107/etc/firejail/skype.profile 107/etc/firejail/skype.profile
108/etc/firejail/skypeforlinux.profile 108/etc/firejail/skypeforlinux.profile
109/etc/firejail/slack.profile
109/etc/firejail/snap.profile 110/etc/firejail/snap.profile
110/etc/firejail/soffice.profile 111/etc/firejail/soffice.profile
111/etc/firejail/spotify.profile 112/etc/firejail/spotify.profile
diff --git a/src/include/common.h b/src/include/common.h
index cd4b9c874..762a0262a 100644
--- a/src/include/common.h
+++ b/src/include/common.h
@@ -113,4 +113,5 @@ int join_namespace(pid_t pid, char *type);
113int name2pid(const char *name, pid_t *pid); 113int name2pid(const char *name, pid_t *pid);
114char *pid_proc_comm(const pid_t pid); 114char *pid_proc_comm(const pid_t pid);
115char *pid_proc_cmdline(const pid_t pid); 115char *pid_proc_cmdline(const pid_t pid);
116int pid_proc_cmdline_x11(const pid_t pid);
116#endif 117#endif
diff --git a/src/lib/common.c b/src/lib/common.c
index 8ea926df1..fe5c62536 100644
--- a/src/lib/common.c
+++ b/src/lib/common.c
@@ -199,3 +199,63 @@ char *pid_proc_cmdline(const pid_t pid) {
199 } 199 }
200 return rv; 200 return rv;
201} 201}
202
203// return 1 if firejail --x11 on command line
204int pid_proc_cmdline_x11(const pid_t pid) {
205 // if comm is not firejail return 0
206 char *comm = pid_proc_comm(pid);
207 if (strcmp(comm, "firejail") != 0) {
208 free(comm);
209 return 0;
210 }
211 free(comm);
212
213 // open /proc/pid/cmdline file
214 char *fname;
215 int fd;
216 if (asprintf(&fname, "/proc/%d/cmdline", pid) == -1)
217 return 0;
218 if ((fd = open(fname, O_RDONLY)) < 0) {
219 free(fname);
220 return 0;
221 }
222 free(fname);
223
224 // read file
225 unsigned char buffer[BUFLEN];
226 ssize_t len;
227 if ((len = read(fd, buffer, sizeof(buffer) - 1)) <= 0) {
228 close(fd);
229 return 0;
230 }
231 buffer[len] = '\0';
232 close(fd);
233
234 // skip the first argument
235 int i;
236 for (i = 0; buffer[i] != '\0'; i++);
237
238 // parse remaining command line options
239 while (1) {
240 // extract argument
241 i++;
242 if (i >= len)
243 break;
244 char *arg = buffer + i;
245
246 // detect the last command line option
247 if (strcmp(arg, "--") == 0)
248 break;
249 if (strncmp(arg, "--", 2) != 0)
250 break;
251
252 // check x11
253 if (strncmp(arg, "--x11", 5) == 0)
254 return 1;
255 i += strlen(arg);
256 }
257 return 0;
258}
259
260
261
diff --git a/src/lib/pid.c b/src/lib/pid.c
index d1ade389e..bbb123b81 100644
--- a/src/lib/pid.c
+++ b/src/lib/pid.c
@@ -340,18 +340,12 @@ void pid_read(pid_t mon_pid) {
340 exit(1); 340 exit(1);
341 } 341 }
342 342
343 if (mon_pid == 0 && strncmp(ptr, "firejail", 8) == 0) { 343 if ((strncmp(ptr, "firejail", 8) == 0) && (mon_pid == 0 || mon_pid == pid)) {
344 pids[pid].level = 1; 344 if (pid_proc_cmdline_x11(pid))
345 pids[pid].level = -1;
346 else
347 pids[pid].level = 1;
345 } 348 }
346 else if (mon_pid == pid && strncmp(ptr, "firejail", 8) == 0) {
347 pids[pid].level = 1;
348 }
349// else if (mon_pid == 0 && strncmp(ptr, "lxc-execute", 11) == 0) {
350// pids[pid].level = 1;
351// }
352// else if (mon_pid == pid && strncmp(ptr, "lxc-execute", 11) == 0) {
353// pids[pid].level = 1;
354// }
355 else 349 else
356 pids[pid].level = -1; 350 pids[pid].level = -1;
357 } 351 }