summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Fred-Barclay <Fred-Barclay@users.noreply.github.com>2017-09-19 23:26:22 -0500
committerLibravatar Fred-Barclay <Fred-Barclay@users.noreply.github.com>2017-09-19 23:26:22 -0500
commit88c3a266eaaab9a41fe56c7c012ced5d6c33c6d2 (patch)
treeff4ab558330f8c566ddf7e9909a57e71913a232a
parentFix private-bit filter for firefox on Arch (diff)
parentadd nogroups (diff)
downloadfirejail-88c3a266eaaab9a41fe56c7c012ced5d6c33c6d2.tar.gz
firejail-88c3a266eaaab9a41fe56c7c012ced5d6c33c6d2.tar.zst
firejail-88c3a266eaaab9a41fe56c7c012ced5d6c33c6d2.zip
Merge branch 'master' of https://github.com/netblue30/firejail
-rw-r--r--.gitignore1
-rw-r--r--Makefile.in4
-rw-r--r--README14
-rw-r--r--README.md74
-rw-r--r--RELNOTES1
-rwxr-xr-xconfigure3
-rw-r--r--configure.ac2
-rw-r--r--etc/2048-qt.profile2
-rw-r--r--etc/Natron.profile6
-rw-r--r--etc/Viber.profile38
-rw-r--r--etc/akregator.profile7
-rw-r--r--etc/amarok.profile2
-rw-r--r--etc/amule.profile40
-rw-r--r--etc/ardour4.profile6
-rw-r--r--etc/ardour5.profile37
-rw-r--r--etc/audacious.profile1
-rw-r--r--etc/brackets.profile29
-rw-r--r--etc/calibre.profile2
-rw-r--r--etc/calligra.profile29
-rw-r--r--etc/calligraauthor.profile6
-rw-r--r--etc/calligraconverter.profile6
-rw-r--r--etc/calligraflow.profile6
-rw-r--r--etc/calligraplan.profile6
-rw-r--r--etc/calligraplanwork.profile6
-rw-r--r--etc/calligrasheets.profile6
-rw-r--r--etc/calligrastage.profile6
-rw-r--r--etc/calligrawords.profile6
-rw-r--r--etc/catfish.profile7
-rw-r--r--etc/chromium.profile1
-rw-r--r--etc/cin.profile31
-rw-r--r--etc/clamav.profile32
-rw-r--r--etc/clamdscan.profile6
-rw-r--r--etc/clamdtop.profile6
-rw-r--r--etc/clamscan.profile6
-rw-r--r--etc/conky.profile35
-rw-r--r--etc/darktable.profile1
-rw-r--r--etc/dia.profile1
-rw-r--r--etc/digikam.profile2
-rw-r--r--etc/disable-common.inc4
-rw-r--r--etc/disable-programs.inc10
-rw-r--r--etc/dooble-qt4.profile6
-rw-r--r--etc/dooble.profile (renamed from smtube.profile)24
-rw-r--r--etc/dosbox.profile2
-rw-r--r--etc/dragon.profile2
-rw-r--r--etc/electron.profile3
-rw-r--r--etc/evince.profile2
-rw-r--r--etc/fetchmail.profile29
-rw-r--r--etc/firefox.profile1
-rw-r--r--etc/freecad.profile35
-rw-r--r--etc/freecadcmd.profile6
-rw-r--r--etc/freshclam.profile34
-rw-r--r--etc/galculator.profile1
-rw-r--r--etc/gimp.profile2
-rw-r--r--etc/gnome-calculator.profile1
-rw-r--r--etc/google-earth.profile48
-rw-r--r--etc/gpicview.profile2
-rw-r--r--etc/handbrake.profile2
-rw-r--r--etc/hugin.profile1
-rw-r--r--etc/imagej.profile35
-rw-r--r--etc/inkscape.profile3
-rw-r--r--etc/k3b.profile2
-rw-r--r--etc/karbon.profile6
-rw-r--r--etc/kate.profile2
-rw-r--r--etc/kcalc.profile2
-rw-r--r--etc/kdenlive.profile30
-rw-r--r--etc/krita.profile32
-rw-r--r--etc/kwrite.profile2
-rw-r--r--etc/leafpad.profile2
-rw-r--r--etc/libreoffice.profile2
-rw-r--r--etc/linphone.profile41
-rw-r--r--etc/lmms.profile34
-rw-r--r--etc/luminance-hdr.profile1
-rw-r--r--etc/macrofusion.profile35
-rw-r--r--etc/mousepad.profile2
-rw-r--r--etc/mpd.profile33
-rw-r--r--etc/mpv.profile2
-rw-r--r--etc/musescore.profile1
-rw-r--r--etc/natron.profile33
-rw-r--r--etc/okular.profile2
-rw-r--r--etc/pidgin.profile3
-rw-r--r--etc/ricochet.profile40
-rw-r--r--etc/riot-web.profile4
-rw-r--r--etc/rocketchat.profile14
-rw-r--r--etc/scribus.profile1
-rw-r--r--etc/shotcut.profile31
-rw-r--r--etc/silentarmy.profile3
-rw-r--r--etc/skype.profile1
-rw-r--r--etc/ssh-agent.profile1
-rw-r--r--etc/steam.profile4
-rw-r--r--etc/surf.profile35
-rw-r--r--etc/synfigstudio.profile1
-rw-r--r--etc/teamspeak3.profile39
-rw-r--r--etc/terasology.profile42
-rw-r--r--etc/tor-browser-en.profile6
-rw-r--r--etc/tor.profile47
-rw-r--r--etc/torbrowser-launcher.profile11
-rw-r--r--etc/transmission-gtk.profile1
-rw-r--r--etc/transmission-qt.profile1
-rw-r--r--etc/tuxguitar.profile1
-rw-r--r--etc/virtualbox.profile2
-rw-r--r--etc/vlc.profile2
-rw-r--r--etc/whitelist-common.inc8
-rw-r--r--etc/whitelist-var-common.inc11
-rw-r--r--etc/x-terminal-emulator.profile20
-rw-r--r--etc/xmr-stak-cpu.profile42
-rw-r--r--etc/youtube-dl.profile2
-rw-r--r--etc/zart.profile30
-rw-r--r--platform/debian/conffiles1
-rw-r--r--src/fbuilder/Makefile.in45
-rw-r--r--src/fbuilder/build_bin.c121
-rw-r--r--src/fbuilder/build_fs.c280
-rw-r--r--src/fbuilder/build_home.c199
-rw-r--r--src/fbuilder/build_profile.c165
-rw-r--r--src/fbuilder/build_seccomp.c191
-rw-r--r--src/fbuilder/fbuilder.h68
-rw-r--r--src/fbuilder/filedb.c79
-rw-r--r--src/fbuilder/main.c71
-rw-r--r--src/fbuilder/utils.c72
-rw-r--r--src/fcopy/main.c19
-rw-r--r--src/firecfg/firecfg.config42
-rw-r--r--src/firecfg/main.c34
-rw-r--r--src/firejail/main.c22
-rw-r--r--src/firejail/usage.c1
-rw-r--r--src/firejail/util.c2
-rw-r--r--src/libtrace/libtrace.c12
-rw-r--r--src/man/firejail.txt12
126 files changed, 2793 insertions, 37 deletions
diff --git a/.gitignore b/.gitignore
index 554d1985b..0882eeecf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,7 @@ src/fnet/fnet
25src/fseccomp/fseccomp 25src/fseccomp/fseccomp
26src/fcopy/fcopy 26src/fcopy/fcopy
27src/fldd/fldd 27src/fldd/fldd
28src/fbuilder/fbuilder
28uids.h 29uids.h
29seccomp 30seccomp
30seccomp.debug 31seccomp.debug
diff --git a/Makefile.in b/Makefile.in
index e20aa5b62..be5ab837f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,6 +1,6 @@
1all: apps man filters 1all: apps man filters
2MYLIBS = src/lib 2MYLIBS = src/lib
3APPS = src/firejail src/firemon src/firecfg src/libtrace src/libtracelog src/ftee src/faudit src/fnet src/fseccomp src/fcopy src/fldd src/libpostexecseccomp 3APPS = src/firejail src/firemon src/firecfg src/libtrace src/libtracelog src/ftee src/faudit src/fnet src/fseccomp src/fbuilder src/fcopy src/fldd src/libpostexecseccomp
4MANPAGES = firejail.1 firemon.1 firecfg.1 firejail-profile.5 firejail-login.5 4MANPAGES = firejail.1 firemon.1 firecfg.1 firejail-profile.5 firejail-login.5
5SECCOMP_FILTERS = seccomp seccomp.debug seccomp.32 seccomp.64 seccomp.block_secondary seccomp.mdwx 5SECCOMP_FILTERS = seccomp seccomp.debug seccomp.32 seccomp.64 seccomp.block_secondary seccomp.mdwx
6 6
@@ -99,6 +99,7 @@ endif
99 install -c -m 0755 src/fnet/fnet $(DESTDIR)/$(libdir)/firejail/. 99 install -c -m 0755 src/fnet/fnet $(DESTDIR)/$(libdir)/firejail/.
100 install -c -m 0755 src/fcopy/fcopy $(DESTDIR)/$(libdir)/firejail/. 100 install -c -m 0755 src/fcopy/fcopy $(DESTDIR)/$(libdir)/firejail/.
101 install -c -m 0755 src/fldd/fldd $(DESTDIR)/$(libdir)/firejail/. 101 install -c -m 0755 src/fldd/fldd $(DESTDIR)/$(libdir)/firejail/.
102 install -c -m 0755 src/fbuilder/fbuilder $(DESTDIR)/$(libdir)/firejail/.
102ifeq ($(HAVE_SECCOMP),-DHAVE_SECCOMP) 103ifeq ($(HAVE_SECCOMP),-DHAVE_SECCOMP)
103 install -c -m 0755 src/fseccomp/fseccomp $(DESTDIR)/$(libdir)/firejail/. 104 install -c -m 0755 src/fseccomp/fseccomp $(DESTDIR)/$(libdir)/firejail/.
104 install -c -m 0644 seccomp $(DESTDIR)/$(libdir)/firejail/. 105 install -c -m 0644 seccomp $(DESTDIR)/$(libdir)/firejail/.
@@ -169,6 +170,7 @@ install-strip: all
169 strip src/fseccomp/fseccomp 170 strip src/fseccomp/fseccomp
170 strip src/fcopy/fcopy 171 strip src/fcopy/fcopy
171 strip src/fldd/fldd 172 strip src/fldd/fldd
173 strip src/fbuilder/fbuilder
172 $(MAKE) realinstall 174 $(MAKE) realinstall
173 175
174uninstall: 176uninstall:
diff --git a/README b/README
index da5c39516..239cd26b0 100644
--- a/README
+++ b/README
@@ -112,6 +112,10 @@ creideiki (https://github.com/creideiki)
112 - make the sandbox process reap all children 112 - make the sandbox process reap all children
113chiraag-nataraj (https://github.com/chiraag-nataraj) 113chiraag-nataraj (https://github.com/chiraag-nataraj)
114 - support for newer Xpra versions (2.1+) 114 - support for newer Xpra versions (2.1+)
115 - added Viber, amule, ardour5, brackets, calligra, cin, fetchmail profiles
116 - added freecad, google-earth, imagej, kdenlive, linphone, lmms profiles
117 - added macrofusion, mpd, natron, ricochet, shotcut, tor-browser-en profiles
118 - added tor, x-terminal-emulator, zart profiles
115Christian Stadelmann (https://github.com/genodeftest) 119Christian Stadelmann (https://github.com/genodeftest)
116 - profile fixes 120 - profile fixes
117 - evolution profile fix 121 - evolution profile fix
@@ -241,12 +245,15 @@ Impyy (https://github.com/Impyy)
241 - added mumble profile 245 - added mumble profile
242irregulator (https://github.com/irregulator) 246irregulator (https://github.com/irregulator)
243 - thunderbird profile fixes for debian stretch 247 - thunderbird profile fixes for debian stretch
248Irvine (https://github.com/Irvinehimself)
249 - added conky profile
244Ivan Kozik (https://github.com/ivan) 250Ivan Kozik (https://github.com/ivan)
245 - speed up sandbox exit 251 - speed up sandbox exit
246Jaykishan Mutkawoa (https://github.com/jmutkawoa) 252Jaykishan Mutkawoa (https://github.com/jmutkawoa)
247 - cpio profile 253 - cpio profile
248James Elford (https://github.com/jelford) 254James Elford (https://github.com/jelford)
249 - pass password manager support 255 - pass password manager support
256 - removed shell none from ssh-agent configuration, fixing the infinit loop
250Jericho (https://github.com/attritionorg) 257Jericho (https://github.com/attritionorg)
251 - spelling 258 - spelling
252Jesse Smith (https://github.com/slicer69) 259Jesse Smith (https://github.com/slicer69)
@@ -306,6 +313,8 @@ Mattias Wadman (https://github.com/wader)
306 - seccomp errno filter support 313 - seccomp errno filter support
307Matthew Gyurgyik (https://github.com/pyther) 314Matthew Gyurgyik (https://github.com/pyther)
308 - rpm spec and several fixes 315 - rpm spec and several fixes
316melvinvermeeren (https://github.com/melvinvermeeren)
317 - added teamspeak3 profile
309Michael Haas (https://github.com/mhaas) 318Michael Haas (https://github.com/mhaas)
310 - bugfixes 319 - bugfixes
311Mike Frysinger (vapier@gentoo.org) 320Mike Frysinger (vapier@gentoo.org)
@@ -319,6 +328,8 @@ n1trux (https://github.com/n1trux)
319netblue30 (netblue30@yahoo.com) 328netblue30 (netblue30@yahoo.com)
320Niklas Haas (https://github.com/haasn) 329Niklas Haas (https://github.com/haasn)
321 - blacklisting for keybase.io's client 330 - blacklisting for keybase.io's client
331nyancat18 (https://github.com/nyancat18)
332 - added ardour4, dooble, karbon, krita profiles
322Ondra Nekola (https://github.com/satai) 333Ondra Nekola (https://github.com/satai)
323 - allow firefox theming with non-global themes 334 - allow firefox theming with non-global themes
324Panzerfather (https://github.com/Panzerfather) 335Panzerfather (https://github.com/Panzerfather)
@@ -416,6 +427,7 @@ smithsohu (https://github.com/smitsohu)
416 - enhance mutt, goobox, baloo and clementine profiles 427 - enhance mutt, goobox, baloo and clementine profiles
417soredake (https://github.com/soredake) 428soredake (https://github.com/soredake)
418 - fix steam startup with >=llvm-4 429 - fix steam startup with >=llvm-4
430 - fix handling of STEAM_RUNTIME_PREFER_HOST_LIBRARIES in steam profile
419SpotComms (https://github.com/SpotComms) 431SpotComms (https://github.com/SpotComms)
420 - added Bless, Gnome 2048, Gnome Calculator, Gnome Contacts, JD-GUI, Lollypop, MultiMC5 profiles 432 - added Bless, Gnome 2048, Gnome Calculator, Gnome Contacts, JD-GUI, Lollypop, MultiMC5 profiles
421 - added PDFSam, Pithos, and Xonotic profiles 433 - added PDFSam, Pithos, and Xonotic profiles
@@ -507,6 +519,8 @@ Topi Miettinen (https://github.com/topimiettinen)
507 - seccomp default list update 519 - seccomp default list update
508 - improve loading of seccomp filter and memory-deny-write-execute feature 520 - improve loading of seccomp filter and memory-deny-write-execute feature
509 - private-lib feature 521 - private-lib feature
522user1024 (user1024@tut.by)
523 - electron profile whitelisting
510valoq (https://github.com/valoq) 524valoq (https://github.com/valoq)
511 - lots of profile fixes 525 - lots of profile fixes
512 - added support for /srv in --whitelist feature 526 - added support for /srv in --whitelist feature
diff --git a/README.md b/README.md
index 255384e2e..efc102ba1 100644
--- a/README.md
+++ b/README.md
@@ -98,6 +98,70 @@ Use this issue to request new profiles: [#1139](https://github.com/netblue30/fir
98````` 98`````
99# Current development version: 0.9.51 99# Current development version: 0.9.51
100 100
101## Whitelisting /var
102
103Add "include /etc/firejail/whitelist-var-common.inc" to an application profile and test it. If it's working,
104send a pull request. I did it so far for some more common applications like Firefox, Chromium etc.
105
106## Profile build tool
107`````
108$ firejail --build appname
109`````
110The command builds a whitelisted profile. If /usr/bin/strace is installed on the system, it also
111builds a whitelisted seccomp profile. The program is run in a very relaxed sandbox,
112with only --caps.drop=all and --nonewprivs. Programs that raise user privileges are not supported
113in order to allow strace to run. Chromium and Chromium-based browsers will not work.
114
115Example:
116`````
117$ firejail --build /usr/bin/vlc ~/Videos/test.mp4
118
119[...]
120
121############################################
122# /usr/bin/vlc profile
123############################################
124# Persistent global definitions
125# include /etc/firejail/globals.local
126
127### basic blacklisting
128include /etc/firejail/disable-common.inc
129# include /etc/firejail/disable-devel.inc
130include /etc/firejail/disable-passwdmgr.inc
131# include /etc/firejail/disable-programs.inc
132
133### home directory whitelisting
134whitelist ~/Videos
135whitelist ~/.local/share/vlc
136whitelist ~/.config/vlc
137include /etc/firejail/whitelist-common.inc
138
139### filesystem
140private-tmp
141private-dev
142private-etc vdpau_wrapper.cfg,udev,drirc,fonts,xdg,gtk-3.0,machine-id,selinux,
143whitelist /var/lib/menu-xdg
144# private-bin vlc,
145
146### security filters
147caps.drop all
148nonewprivs
149seccomp
150# seccomp.keep futex,poll,rt_sigtimedwait,ioctl,fdatasync,read,writev,sendmsg,sendto,write,recvmsg,mmap,mprotect,getpid,stat,clock_nanosleep,munmap,close,access,lseek,fcntl,open,fstat,lstat,brk,rt_sigaction,rt_sigprocmask,rt_sigreturn,madvise,shmget,shmat,shmctl,alarm,socket,connect,recvfrom,shutdown,getsockname,getpeername,setsockopt,getsockopt,clone,execve,uname,shmdt,flock,ftruncate,getdents,rename,mkdir,unlink,readlink,chmod,getrlimit,sysinfo,getuid,getgid,geteuid,getegid,getresuid,getresgid,statfs,fstatfs,prctl,arch_prctl,sched_getaffinity,set_tid_address,fadvise64,clock_getres,tgkill,set_robust_list,eventfd2,dup3,pipe2,getrandom,memfd_create
151# 76 syscalls total
152# Probably you will need to add more syscalls to seccomp.keep. Look for
153# seccomp errors in /var/log/syslog or /var/log/audit/audit.log while
154# running your sandbox.
155
156### network
157protocol unix,netlink,
158net none
159
160### environment
161shell none
162$
163`````
164
101## New command line options 165## New command line options
102````` 166`````
103 --writable-run-user 167 --writable-run-user
@@ -107,3 +171,13 @@ Use this issue to request new profiles: [#1139](https://github.com/netblue30/fir
107 Example: 171 Example:
108 $ sudo firejail --writable-run-user 172 $ sudo firejail --writable-run-user
109````` 173`````
174
175## New profiles:
176
177terasology, surf, rocketchat, clamscan, clamdscan, clamdtop, freshclam, xmr-stak-cpu,
178amule, ardour4, ardour5, brackets, calligra, calligraauthor, calligraconverter,
179calligraflow, calligraplan, calligraplanwork, calligrasheets, calligrastage,
180calligrawords, cin, dooble, dooble-qt4, fetchmail, freecad, freecadcmd, google-earth,
181imagej, karbon, kdenlive, krita, linphone, lmms, macrofusion, mpd, natron, Natron,
182ricochet, shotcut, teamspeak3, tor, tor-browser-en, Viber, x-terminal-emulator, zart,
183conky
diff --git a/RELNOTES b/RELNOTES
index 85c554b32..d4302c134 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -1,6 +1,7 @@
1firejail (0.9.51) baseline; urgency=low 1firejail (0.9.51) baseline; urgency=low
2 * work in progress! 2 * work in progress!
3 * feature: --writable-run-user 3 * feature: --writable-run-user
4 * feature: profile build tool (--build)
4 -- netblue30 <netblue30@yahoo.com> Thu, 14 Sep 2017 20:00:00 -0500 5 -- netblue30 <netblue30@yahoo.com> Thu, 14 Sep 2017 20:00:00 -0500
5 6
6firejail (0.9.50~rc1) baseline; urgency=low 7firejail (0.9.50~rc1) baseline; urgency=low
diff --git a/configure b/configure
index e1cc0147f..f64aa2dac 100755
--- a/configure
+++ b/configure
@@ -3823,7 +3823,7 @@ if test "$prefix" = /usr; then
3823 sysconfdir="/etc" 3823 sysconfdir="/etc"
3824fi 3824fi
3825 3825
3826ac_config_files="$ac_config_files Makefile src/lib/Makefile src/fcopy/Makefile src/fnet/Makefile src/firejail/Makefile src/firemon/Makefile src/libtrace/Makefile src/libtracelog/Makefile src/firecfg/Makefile src/ftee/Makefile src/faudit/Makefile src/fseccomp/Makefile src/fldd/Makefile src/libpostexecseccomp/Makefile" 3826ac_config_files="$ac_config_files Makefile src/lib/Makefile src/fcopy/Makefile src/fnet/Makefile src/firejail/Makefile src/firemon/Makefile src/libtrace/Makefile src/libtracelog/Makefile src/firecfg/Makefile src/fbuilder/Makefile src/ftee/Makefile src/faudit/Makefile src/fseccomp/Makefile src/fldd/Makefile src/libpostexecseccomp/Makefile"
3827 3827
3828cat >confcache <<\_ACEOF 3828cat >confcache <<\_ACEOF
3829# This file is a shell script that caches the results of configure 3829# This file is a shell script that caches the results of configure
@@ -4541,6 +4541,7 @@ do
4541 "src/libtrace/Makefile") CONFIG_FILES="$CONFIG_FILES src/libtrace/Makefile" ;; 4541 "src/libtrace/Makefile") CONFIG_FILES="$CONFIG_FILES src/libtrace/Makefile" ;;
4542 "src/libtracelog/Makefile") CONFIG_FILES="$CONFIG_FILES src/libtracelog/Makefile" ;; 4542 "src/libtracelog/Makefile") CONFIG_FILES="$CONFIG_FILES src/libtracelog/Makefile" ;;
4543 "src/firecfg/Makefile") CONFIG_FILES="$CONFIG_FILES src/firecfg/Makefile" ;; 4543 "src/firecfg/Makefile") CONFIG_FILES="$CONFIG_FILES src/firecfg/Makefile" ;;
4544 "src/fbuilder/Makefile") CONFIG_FILES="$CONFIG_FILES src/fbuilder/Makefile" ;;
4544 "src/ftee/Makefile") CONFIG_FILES="$CONFIG_FILES src/ftee/Makefile" ;; 4545 "src/ftee/Makefile") CONFIG_FILES="$CONFIG_FILES src/ftee/Makefile" ;;
4545 "src/faudit/Makefile") CONFIG_FILES="$CONFIG_FILES src/faudit/Makefile" ;; 4546 "src/faudit/Makefile") CONFIG_FILES="$CONFIG_FILES src/faudit/Makefile" ;;
4546 "src/fseccomp/Makefile") CONFIG_FILES="$CONFIG_FILES src/fseccomp/Makefile" ;; 4547 "src/fseccomp/Makefile") CONFIG_FILES="$CONFIG_FILES src/fseccomp/Makefile" ;;
diff --git a/configure.ac b/configure.ac
index e06512665..900c8b959 100644
--- a/configure.ac
+++ b/configure.ac
@@ -176,7 +176,7 @@ if test "$prefix" = /usr; then
176fi 176fi
177 177
178AC_OUTPUT(Makefile src/lib/Makefile src/fcopy/Makefile src/fnet/Makefile src/firejail/Makefile \ 178AC_OUTPUT(Makefile src/lib/Makefile src/fcopy/Makefile src/fnet/Makefile src/firejail/Makefile \
179src/firemon/Makefile src/libtrace/Makefile src/libtracelog/Makefile src/firecfg/Makefile \ 179src/firemon/Makefile src/libtrace/Makefile src/libtracelog/Makefile src/firecfg/Makefile src/fbuilder/Makefile \
180src/ftee/Makefile src/faudit/Makefile src/fseccomp/Makefile src/fldd/Makefile src/libpostexecseccomp/Makefile) 180src/ftee/Makefile src/faudit/Makefile src/fseccomp/Makefile src/fldd/Makefile src/libpostexecseccomp/Makefile)
181 181
182echo 182echo
diff --git a/etc/2048-qt.profile b/etc/2048-qt.profile
index 06cc69503..964a9e5fa 100644
--- a/etc/2048-qt.profile
+++ b/etc/2048-qt.profile
@@ -13,6 +13,8 @@ include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc 14include /etc/firejail/disable-programs.inc
15 15
16include /etc/firejail/whitelist-var-common.inc
17
16caps.drop all 18caps.drop all
17netfilter 19netfilter
18nodvd 20nodvd
diff --git a/etc/Natron.profile b/etc/Natron.profile
new file mode 100644
index 000000000..b21790fe4
--- /dev/null
+++ b/etc/Natron.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for natron
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/natron.profile
diff --git a/etc/Viber.profile b/etc/Viber.profile
new file mode 100644
index 000000000..03e5f1086
--- /dev/null
+++ b/etc/Viber.profile
@@ -0,0 +1,38 @@
1# Firejail profile for Viber
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/Viber.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.ViberPC
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16whitelist ${DOWNLOADS}
17whitelist ${HOME}/.ViberPC
18include /etc/firejail/whitelist-common.inc
19
20caps.drop all
21ipc-namespace
22netfilter
23nodvd
24nogroups
25nonewprivs
26noroot
27notv
28protocol unix,inet,inet6
29seccomp
30shell none
31
32disable-mnt
33private-bin sh,bash,dash,dig,awk,Viber
34private-etc hosts,fonts,mailcap,resolv.conf,X11,pulse,alternatives,localtime,nsswitch.conf,ssl,proxychains.conf
35private-tmp
36
37noexec ${HOME}
38noexec /tmp
diff --git a/etc/akregator.profile b/etc/akregator.profile
index 12bb06fb5..55434e45b 100644
--- a/etc/akregator.profile
+++ b/etc/akregator.profile
@@ -13,6 +13,12 @@ include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc 14include /etc/firejail/disable-programs.inc
15 15
16mkfile ${HOME}/.config/akregatorrc
17mkdir ${HOME}/.local/share/akregator
18whitelist ${HOME}/.config/akregatorrc
19whitelist ${HOME}/.local/share/akregator
20include /etc/firejail/whitelist-common.inc
21
16caps.drop all 22caps.drop all
17netfilter 23netfilter
18no3d 24no3d
@@ -27,6 +33,7 @@ seccomp
27shell none 33shell none
28 34
29disable-mnt 35disable-mnt
36private-bin akregator,akregatorstorageexporter,dbus-launch,kdeinit5,kshell5,kdeinit5_shutdown,kdeinit5_wrapper,kdeinit4,kshell4,kdeinit4_shutdown,kdeinit4_wrapper
30private-dev 37private-dev
31private-tmp 38private-tmp
32 39
diff --git a/etc/amarok.profile b/etc/amarok.profile
index 478d5285c..79343fcdf 100644
--- a/etc/amarok.profile
+++ b/etc/amarok.profile
@@ -11,6 +11,8 @@ include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc 11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc 12include /etc/firejail/disable-programs.inc
13 13
14include /etc/firejail/whitelist-var-common.inc
15
14caps.drop all 16caps.drop all
15netfilter 17netfilter
16nogroups 18nogroups
diff --git a/etc/amule.profile b/etc/amule.profile
new file mode 100644
index 000000000..98ec52015
--- /dev/null
+++ b/etc/amule.profile
@@ -0,0 +1,40 @@
1# Firejail profile for amule
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/amule.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.aMule
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16whitelist ${DOWNLOADS}
17whitelist ${HOME}/.aMule
18include /etc/firejail/whitelist-common.inc
19
20caps.drop all
21ipc-namespace
22netfilter
23no3d
24nodvd
25nogroups
26nonewprivs
27noroot
28nosound
29notv
30novideo
31protocol unix,inet,inet6
32seccomp
33shell none
34
35private-bin amule
36private-dev
37private-tmp
38
39noexec ${HOME}
40noexec /tmp
diff --git a/etc/ardour4.profile b/etc/ardour4.profile
new file mode 100644
index 000000000..7d1163174
--- /dev/null
+++ b/etc/ardour4.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for ardour5
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/ardour5.profile
diff --git a/etc/ardour5.profile b/etc/ardour5.profile
new file mode 100644
index 000000000..69b3dde46
--- /dev/null
+++ b/etc/ardour5.profile
@@ -0,0 +1,37 @@
1# Firejail profile for ardour5
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/ardour5.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.config/ardour4
10noblacklist ${HOME}/.config/ardour5
11noblacklist ${HOME}/.lv2
12noblacklist ${HOME}/.vst
13
14include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-devel.inc
16include /etc/firejail/disable-passwdmgr.inc
17include /etc/firejail/disable-programs.inc
18
19caps.drop all
20ipc-namespace
21net none
22nodvd
23nogroups
24nonewprivs
25noroot
26notv
27protocol unix
28seccomp
29shell none
30
31#private-bin sh,ardour4,ardour5,ardour5-copy-mixer,ardour5-export,ardour5-fix_bbtppq,grep,sed,ldd,nm
32private-dev
33#private-etc pulse,X11,alternatives,ardour4,ardour5,fonts
34private-tmp
35
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/audacious.profile b/etc/audacious.profile
index bd2367fe0..52e701821 100644
--- a/etc/audacious.profile
+++ b/etc/audacious.profile
@@ -15,6 +15,7 @@ include /etc/firejail/disable-programs.inc
15 15
16caps.drop all 16caps.drop all
17netfilter 17netfilter
18nogroups
18nonewprivs 19nonewprivs
19noroot 20noroot
20notv 21notv
diff --git a/etc/brackets.profile b/etc/brackets.profile
new file mode 100644
index 000000000..0a8c592a7
--- /dev/null
+++ b/etc/brackets.profile
@@ -0,0 +1,29 @@
1# Firejail profile for brackets
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/brackets.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/Brackets
9noblacklist /opt/brackets/
10noblacklist /opt/google/
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17netfilter
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28
29private-dev
diff --git a/etc/calibre.profile b/etc/calibre.profile
index aa0de473c..844231032 100644
--- a/etc/calibre.profile
+++ b/etc/calibre.profile
@@ -13,6 +13,8 @@ include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-passwdmgr.inc 13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc 14include /etc/firejail/disable-programs.inc
15 15
16include /etc/firejail/whitelist-var-common.inc
17
16caps.drop all 18caps.drop all
17netfilter 19netfilter
18no3d 20no3d
diff --git a/etc/calligra.profile b/etc/calligra.profile
new file mode 100644
index 000000000..e90c8efe8
--- /dev/null
+++ b/etc/calligra.profile
@@ -0,0 +1,29 @@
1# Firejail profile for calligra
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/calligra.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8include /etc/firejail/disable-common.inc
9include /etc/firejail/disable-devel.inc
10include /etc/firejail/disable-passwdmgr.inc
11include /etc/firejail/disable-programs.inc
12
13caps.drop all
14ipc-namespace
15nodvd
16nogroups
17nonewprivs
18noroot
19notv
20novideo
21protocol unix
22seccomp
23shell none
24
25private-bin calligra,calligraauthor,calligraconverter,calligraflow,calligraplan,calligraplanwork,calligrasheets,calligrastage,calligrawords,dbus-launch
26private-dev
27
28noexec ${HOME}
29noexec /tmp
diff --git a/etc/calligraauthor.profile b/etc/calligraauthor.profile
new file mode 100644
index 000000000..629ab46c1
--- /dev/null
+++ b/etc/calligraauthor.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligraconverter.profile b/etc/calligraconverter.profile
new file mode 100644
index 000000000..629ab46c1
--- /dev/null
+++ b/etc/calligraconverter.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligraflow.profile b/etc/calligraflow.profile
new file mode 100644
index 000000000..629ab46c1
--- /dev/null
+++ b/etc/calligraflow.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligraplan.profile b/etc/calligraplan.profile
new file mode 100644
index 000000000..629ab46c1
--- /dev/null
+++ b/etc/calligraplan.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligraplanwork.profile b/etc/calligraplanwork.profile
new file mode 100644
index 000000000..629ab46c1
--- /dev/null
+++ b/etc/calligraplanwork.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligrasheets.profile b/etc/calligrasheets.profile
new file mode 100644
index 000000000..629ab46c1
--- /dev/null
+++ b/etc/calligrasheets.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligrastage.profile b/etc/calligrastage.profile
new file mode 100644
index 000000000..629ab46c1
--- /dev/null
+++ b/etc/calligrastage.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligrawords.profile b/etc/calligrawords.profile
new file mode 100644
index 000000000..629ab46c1
--- /dev/null
+++ b/etc/calligrawords.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/catfish.profile b/etc/catfish.profile
index 498f3b6ee..5fc585d90 100644
--- a/etc/catfish.profile
+++ b/etc/catfish.profile
@@ -8,8 +8,13 @@ include /etc/firejail/globals.local
8# We can't blacklist much since catfish 8# We can't blacklist much since catfish
9# is for finding files/content 9# is for finding files/content
10noblacklist ~/.config/catfish 10noblacklist ~/.config/catfish
11include /etc/firejail/disable-common.inc
12# include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
11 15
12include /etc/firejail/disable-devel.inc 16whitelist /var/lib/mlocate
17include /etc/firejail/whitelist-var-common.inc
13 18
14caps.drop all 19caps.drop all
15net none 20net none
diff --git a/etc/chromium.profile b/etc/chromium.profile
index 9be99e68a..0c7058a11 100644
--- a/etc/chromium.profile
+++ b/etc/chromium.profile
@@ -23,6 +23,7 @@ whitelist ~/.config/chromium
23whitelist ~/.config/chromium-flags.conf 23whitelist ~/.config/chromium-flags.conf
24whitelist ~/.pki 24whitelist ~/.pki
25include /etc/firejail/whitelist-common.inc 25include /etc/firejail/whitelist-common.inc
26include /etc/firejail/whitelist-var-common.inc
26 27
27caps.keep sys_chroot,sys_admin 28caps.keep sys_chroot,sys_admin
28netfilter 29netfilter
diff --git a/etc/cin.profile b/etc/cin.profile
new file mode 100644
index 000000000..eeeda476f
--- /dev/null
+++ b/etc/cin.profile
@@ -0,0 +1,31 @@
1# Firejail profile for cin
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/cin.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.bcast5
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16ipc-namespace
17net none
18nodvd
19nogroups
20nonewprivs
21notv
22noroot
23protocol unix
24seccomp
25shell none
26
27#private-bin cin
28private-dev
29
30noexec ${HOME}
31noexec /tmp
diff --git a/etc/clamav.profile b/etc/clamav.profile
new file mode 100644
index 000000000..a5aacc1d5
--- /dev/null
+++ b/etc/clamav.profile
@@ -0,0 +1,32 @@
1# Firejail profile for clamav
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/clamav.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9
10caps.drop all
11ipc-namespace
12net none
13no3d
14nodvd
15nogroups
16nonewprivs
17noroot
18nosound
19notv
20novideo
21protocol unix
22seccomp
23shell none
24tracelog
25x11 none
26
27private-dev
28read-only ${HOME}
29
30memory-deny-write-execute
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/clamdscan.profile b/etc/clamdscan.profile
new file mode 100644
index 000000000..1fc728206
--- /dev/null
+++ b/etc/clamdscan.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for clamav
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/clamav.profile
diff --git a/etc/clamdtop.profile b/etc/clamdtop.profile
new file mode 100644
index 000000000..1fc728206
--- /dev/null
+++ b/etc/clamdtop.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for clamav
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/clamav.profile
diff --git a/etc/clamscan.profile b/etc/clamscan.profile
new file mode 100644
index 000000000..1fc728206
--- /dev/null
+++ b/etc/clamscan.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for clamav
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/clamav.profile
diff --git a/etc/conky.profile b/etc/conky.profile
new file mode 100644
index 000000000..4ee25f099
--- /dev/null
+++ b/etc/conky.profile
@@ -0,0 +1,35 @@
1# Firejail profile for conky
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/conky.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15ipc-namespace
16netfilter
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28
29disable-mnt
30private-dev
31private-tmp
32
33memory-deny-write-execute
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/darktable.profile b/etc/darktable.profile
index e04163486..c2dc0b42c 100644
--- a/etc/darktable.profile
+++ b/etc/darktable.profile
@@ -26,6 +26,7 @@ protocol unix,inet,inet6
26seccomp 26seccomp
27shell none 27shell none
28 28
29#private-bin darktable
29private-dev 30private-dev
30private-tmp 31private-tmp
31 32
diff --git a/etc/dia.profile b/etc/dia.profile
index a625ab36d..abe83ac8c 100644
--- a/etc/dia.profile
+++ b/etc/dia.profile
@@ -27,6 +27,7 @@ seccomp
27shell none 27shell none
28 28
29disable-mnt 29disable-mnt
30#private-bin dia
30private-dev 31private-dev
31private-tmp 32private-tmp
32 33
diff --git a/etc/digikam.profile b/etc/digikam.profile
index 43191ec06..ef518470e 100644
--- a/etc/digikam.profile
+++ b/etc/digikam.profile
@@ -14,6 +14,8 @@ include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc 14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc 15include /etc/firejail/disable-programs.inc
16 16
17include /etc/firejail/whitelist-var-common.inc
18
17caps.drop all 19caps.drop all
18netfilter 20netfilter
19nodvd 21nodvd
diff --git a/etc/disable-common.inc b/etc/disable-common.inc
index 5dd3dfd30..ca6ba9710 100644
--- a/etc/disable-common.inc
+++ b/etc/disable-common.inc
@@ -2,13 +2,15 @@
2# Persistent customizations should go in a .local file. 2# Persistent customizations should go in a .local file.
3include /etc/firejail/disable-common.local 3include /etc/firejail/disable-common.local
4 4
5# History files in $HOME 5# History files and clipboard managers in $HOME
6blacklist-nolog ${HOME}/.*_history 6blacklist-nolog ${HOME}/.*_history
7blacklist-nolog ${HOME}/.adobe 7blacklist-nolog ${HOME}/.adobe
8blacklist-nolog ${HOME}/.bash_history 8blacklist-nolog ${HOME}/.bash_history
9blacklist-nolog ${HOME}/.history 9blacklist-nolog ${HOME}/.history
10blacklist-nolog ${HOME}/.local/share/fish/fish_history 10blacklist-nolog ${HOME}/.local/share/fish/fish_history
11blacklist-nolog ${HOME}/.macromedia 11blacklist-nolog ${HOME}/.macromedia
12blacklist-nolog /tmp/clipmenu*
13blacklist-nolog ${HOME}/.cache/greenclip*
12 14
13# X11 session autostart 15# X11 session autostart
14# blacklist ${HOME}/.xpra - this will kill --x11=xpra cmdline option for all programs 16# blacklist ${HOME}/.xpra - this will kill --x11=xpra cmdline option for all programs
diff --git a/etc/disable-programs.inc b/etc/disable-programs.inc
index 7e44d582e..88b7e7d32 100644
--- a/etc/disable-programs.inc
+++ b/etc/disable-programs.inc
@@ -17,8 +17,10 @@ blacklist ${HOME}/.Steam
17blacklist ${HOME}/.Steampath 17blacklist ${HOME}/.Steampath
18blacklist ${HOME}/.Steampid 18blacklist ${HOME}/.Steampid
19blacklist ${HOME}/.TelegramDesktop 19blacklist ${HOME}/.TelegramDesktop
20blacklist ${HOME}/.ViberPC
20blacklist ${HOME}/.VirtualBox 21blacklist ${HOME}/.VirtualBox
21blacklist ${HOME}/.Wolfram Research 22blacklist ${HOME}/.Wolfram Research
23blacklist ${HOME}/.aMule
22blacklist ${HOME}/.android 24blacklist ${HOME}/.android
23blacklist ${HOME}/.arduino15 25blacklist ${HOME}/.arduino15
24blacklist ${HOME}/.atom 26blacklist ${HOME}/.atom
@@ -35,6 +37,7 @@ blacklist ${HOME}/.config/Brackets
35blacklist ${HOME}/.config/Clementine 37blacklist ${HOME}/.config/Clementine
36blacklist ${HOME}/.config/Cryptocat 38blacklist ${HOME}/.config/Cryptocat
37blacklist ${HOME}/.config/Franz 39blacklist ${HOME}/.config/Franz
40blacklist ${HOME}/.config/FreeCAD
38blacklist ${HOME}/.config/Gitter 41blacklist ${HOME}/.config/Gitter
39blacklist ${HOME}/.config/Google 42blacklist ${HOME}/.config/Google
40blacklist ${HOME}/.config/Gpredict 43blacklist ${HOME}/.config/Gpredict
@@ -51,6 +54,7 @@ blacklist ${HOME}/.config/Qlipper
51blacklist ${HOME}/.config/QuiteRss 54blacklist ${HOME}/.config/QuiteRss
52blacklist ${HOME}/.config/QuiteRssrc 55blacklist ${HOME}/.config/QuiteRssrc
53blacklist ${HOME}/.config/Riot 56blacklist ${HOME}/.config/Riot
57blacklist ${HOME}/.config/Rocket.Chat
54blacklist ${HOME}/.config/Slack 58blacklist ${HOME}/.config/Slack
55blacklist ${HOME}/.config/Thunar 59blacklist ${HOME}/.config/Thunar
56blacklist ${HOME}/.config/VirtualBox 60blacklist ${HOME}/.config/VirtualBox
@@ -123,6 +127,7 @@ blacklist ${HOME}/.config/lximage-qt
123blacklist ${HOME}/.config/mate-calc 127blacklist ${HOME}/.config/mate-calc
124blacklist ${HOME}/.config/mate/eom 128blacklist ${HOME}/.config/mate/eom
125blacklist ${HOME}/.config/mate/mate-dictionary 129blacklist ${HOME}/.config/mate/mate-dictionary
130blacklist ${HOME}/.config/mfusion
126blacklist ${HOME}/.config/midori 131blacklist ${HOME}/.config/midori
127blacklist ${HOME}/.config/mpv 132blacklist ${HOME}/.config/mpv
128blacklist ${HOME}/.config/mupen64plus 133blacklist ${HOME}/.config/mupen64plus
@@ -187,6 +192,7 @@ blacklist ${HOME}/.conkeror.mozdev.org
187blacklist ${HOME}/.curlrc 192blacklist ${HOME}/.curlrc
188blacklist ${HOME}/.dia 193blacklist ${HOME}/.dia
189blacklist ${HOME}/.dillo 194blacklist ${HOME}/.dillo
195blacklist ${HOME}/.dooble
190blacklist ${HOME}/.dosbox 196blacklist ${HOME}/.dosbox
191blacklist ${HOME}/.dropbox-dist 197blacklist ${HOME}/.dropbox-dist
192blacklist ${HOME}/.electrum* 198blacklist ${HOME}/.electrum*
@@ -211,6 +217,7 @@ blacklist ${HOME}/.guayadeque
211blacklist ${HOME}/.hedgewars 217blacklist ${HOME}/.hedgewars
212blacklist ${HOME}/.hugin 218blacklist ${HOME}/.hugin
213blacklist ${HOME}/.icedove 219blacklist ${HOME}/.icedove
220blacklist ${HOME}/.imagej
214blacklist ${HOME}/.inkscape 221blacklist ${HOME}/.inkscape
215blacklist ${HOME}/.java 222blacklist ${HOME}/.java
216blacklist ${HOME}/.jitsi 223blacklist ${HOME}/.jitsi
@@ -318,6 +325,7 @@ blacklist ${HOME}/.local/share/spotify
318blacklist ${HOME}/.local/share/steam 325blacklist ${HOME}/.local/share/steam
319blacklist ${HOME}/.local/share/supertux2 326blacklist ${HOME}/.local/share/supertux2
320blacklist ${HOME}/.local/share/telepathy 327blacklist ${HOME}/.local/share/telepathy
328blacklist ${HOME}/.local/share/terasology
321blacklist ${HOME}/.local/share/torbrowser 329blacklist ${HOME}/.local/share/torbrowser
322blacklist ${HOME}/.local/share/totem 330blacklist ${HOME}/.local/share/totem
323blacklist ${HOME}/.local/share/vpltd 331blacklist ${HOME}/.local/share/vpltd
@@ -360,6 +368,7 @@ blacklist ${HOME}/.steampath
360blacklist ${HOME}/.steampid 368blacklist ${HOME}/.steampid
361blacklist ${HOME}/.stellarium 369blacklist ${HOME}/.stellarium
362blacklist ${HOME}/.subversion 370blacklist ${HOME}/.subversion
371blacklist ${HOME}/.surf
363blacklist ${HOME}/.sword 372blacklist ${HOME}/.sword
364blacklist ${HOME}/.sylpheed-2.0 373blacklist ${HOME}/.sylpheed-2.0
365blacklist ${HOME}/.synfig 374blacklist ${HOME}/.synfig
@@ -407,6 +416,7 @@ blacklist ${HOME}/.cache/google-chrome
407blacklist ${HOME}/.cache/google-chrome-beta 416blacklist ${HOME}/.cache/google-chrome-beta
408blacklist ${HOME}/.cache/google-chrome-unstable 417blacklist ${HOME}/.cache/google-chrome-unstable
409blacklist ${HOME}/.cache/icedove 418blacklist ${HOME}/.cache/icedove
419blacklist ${HOME}/.cache/INRIA/Natron
410blacklist ${HOME}/.cache/inox 420blacklist ${HOME}/.cache/inox
411blacklist ${HOME}/.cache/libgweather 421blacklist ${HOME}/.cache/libgweather
412blacklist ${HOME}/.cache/midori 422blacklist ${HOME}/.cache/midori
diff --git a/etc/dooble-qt4.profile b/etc/dooble-qt4.profile
new file mode 100644
index 000000000..4e1227a0f
--- /dev/null
+++ b/etc/dooble-qt4.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for dooble
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/dooble.profile
diff --git a/smtube.profile b/etc/dooble.profile
index 2694dd5b0..2a57b0ef3 100644
--- a/smtube.profile
+++ b/etc/dooble.profile
@@ -1,35 +1,37 @@
1# Firejail profile for smtube 1# Firejail profile for dooble
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/smtube.local 4include /etc/firejail/dooble-qt4.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include /etc/firejail/globals.local
7 7
8noblacklist ${HOME}/.config/smplayer 8
9noblacklist ${HOME}/.config/smtube 9noblacklist ${HOME}/.dooble
10noblacklist ${HOME}/.config/mpv
11noblacklist ${HOME}/.mplayer
12noblacklist ${HOME}/.config/vlc
13noblacklist ${HOME}/.local/share/vlc
14 10
15include /etc/firejail/disable-common.inc 11include /etc/firejail/disable-common.inc
16include /etc/firejail/disable-devel.inc 12include /etc/firejail/disable-devel.inc
17include /etc/firejail/disable-passwdmgr.inc 13include /etc/firejail/disable-passwdmgr.inc
18include /etc/firejail/disable-programs.inc 14include /etc/firejail/disable-programs.inc
19 15
16mkdir ${HOME}/.dooble
17whitelist ${DOWNLOADS}
18whitelist ${HOME}/.dooble
19include /etc/firejail/whitelist-common.inc
20
20caps.drop all 21caps.drop all
21netfilter 22netfilter
22nodvd 23nodvd
23notv
24novideo
25nogroups 24nogroups
26nonewprivs 25nonewprivs
27noroot 26noroot
27notv
28novideo
28protocol unix,inet,inet6,netlink 29protocol unix,inet,inet6,netlink
29seccomp 30seccomp
30shell none 31shell none
32tracelog
31 33
32#no private-bin because users can add their own players to smtube and that would prevent that 34disable-mnt
33private-dev 35private-dev
34private-tmp 36private-tmp
35 37
diff --git a/etc/dosbox.profile b/etc/dosbox.profile
index fa9b26e82..a64578e5c 100644
--- a/etc/dosbox.profile
+++ b/etc/dosbox.profile
@@ -12,6 +12,8 @@ include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc 13include /etc/firejail/disable-programs.inc
14 14
15include /etc/firejail/whitelist-var-common.inc
16
15caps.drop all 17caps.drop all
16netfilter 18netfilter
17nodvd 19nodvd
diff --git a/etc/dragon.profile b/etc/dragon.profile
index 211c2432f..c37f81ac9 100644
--- a/etc/dragon.profile
+++ b/etc/dragon.profile
@@ -12,6 +12,8 @@ include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc 13include /etc/firejail/disable-programs.inc
14 14
15include /etc/firejail/whitelist-var-common.inc
16
15caps.drop all 17caps.drop all
16netfilter 18netfilter
17nodvd 19nodvd
diff --git a/etc/electron.profile b/etc/electron.profile
index 9b21c1bfd..91e5cd3df 100644
--- a/etc/electron.profile
+++ b/etc/electron.profile
@@ -5,11 +5,12 @@ include /etc/firejail/electron.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include /etc/firejail/globals.local
7 7
8
9include /etc/firejail/disable-common.inc 8include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-passwdmgr.inc 9include /etc/firejail/disable-passwdmgr.inc
11include /etc/firejail/disable-programs.inc 10include /etc/firejail/disable-programs.inc
12 11
12whitelist ${DOWNLOADS}
13
13caps.drop all 14caps.drop all
14netfilter 15netfilter
15nodvd 16nodvd
diff --git a/etc/evince.profile b/etc/evince.profile
index 5c6215bb2..f503b9a8e 100644
--- a/etc/evince.profile
+++ b/etc/evince.profile
@@ -12,6 +12,8 @@ include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc 13include /etc/firejail/disable-programs.inc
14 14
15include /etc/firejail/whitelist-var-common.inc
16
15caps.drop all 17caps.drop all
16netfilter 18netfilter
17no3d 19no3d
diff --git a/etc/fetchmail.profile b/etc/fetchmail.profile
new file mode 100644
index 000000000..3fd7f3d75
--- /dev/null
+++ b/etc/fetchmail.profile
@@ -0,0 +1,29 @@
1# Firejail profile for fetchmail
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/fetchmail.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15netfilter
16no3d
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix,inet,inet6
25seccomp
26shell none
27
28#private-bin fetchmail,procmail,bash,chmod
29private-dev
diff --git a/etc/firefox.profile b/etc/firefox.profile
index 85201b021..1f4a8e3f6 100644
--- a/etc/firefox.profile
+++ b/etc/firefox.profile
@@ -59,6 +59,7 @@ whitelist ~/.wine-pipelight64
59whitelist ~/.zotero 59whitelist ~/.zotero
60whitelist ~/dwhelper 60whitelist ~/dwhelper
61include /etc/firejail/whitelist-common.inc 61include /etc/firejail/whitelist-common.inc
62include /etc/firejail/whitelist-var-common.inc
62 63
63caps.drop all 64caps.drop all
64netfilter 65netfilter
diff --git a/etc/freecad.profile b/etc/freecad.profile
new file mode 100644
index 000000000..4fde66839
--- /dev/null
+++ b/etc/freecad.profile
@@ -0,0 +1,35 @@
1# Firejail profile for freecad
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/freecad.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.config/FreeCAD
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17ipc-namespace
18net none
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30private-bin freecad,freecadcmd
31private-dev
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/freecadcmd.profile b/etc/freecadcmd.profile
new file mode 100644
index 000000000..f8bbff593
--- /dev/null
+++ b/etc/freecadcmd.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for freecad
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/freecad.profile
diff --git a/etc/freshclam.profile b/etc/freshclam.profile
new file mode 100644
index 000000000..08eac5595
--- /dev/null
+++ b/etc/freshclam.profile
@@ -0,0 +1,34 @@
1# Firejail profile for freshclam
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/clamav.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9
10caps.keep setgid,setuid
11ipc-namespace
12netfilter
13no3d
14nodvd
15nogroups
16nonewprivs
17nosound
18notv
19novideo
20protocol unix,inet,inet6
21seccomp
22shell none
23tracelog
24
25disable-mnt
26private
27private-dev
28private-tmp
29writable-var
30writable-var-log
31
32memory-deny-write-execute
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/galculator.profile b/etc/galculator.profile
index 37f147f0f..dbc22a889 100644
--- a/etc/galculator.profile
+++ b/etc/galculator.profile
@@ -15,6 +15,7 @@ include /etc/firejail/disable-programs.inc
15mkdir ~/.config/galculator 15mkdir ~/.config/galculator
16whitelist ~/.config/galculator 16whitelist ~/.config/galculator
17include /etc/firejail/whitelist-common.inc 17include /etc/firejail/whitelist-common.inc
18include /etc/firejail/whitelist-var-common.inc
18 19
19caps.drop all 20caps.drop all
20net none 21net none
diff --git a/etc/gimp.profile b/etc/gimp.profile
index aa77d6105..292c2aac9 100644
--- a/etc/gimp.profile
+++ b/etc/gimp.profile
@@ -11,6 +11,8 @@ include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-passwdmgr.inc 11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc 12include /etc/firejail/disable-programs.inc
13 13
14include /etc/firejail/whitelist-var-common.inc
15
14caps.drop all 16caps.drop all
15net none 17net none
16nodvd 18nodvd
diff --git a/etc/gnome-calculator.profile b/etc/gnome-calculator.profile
index 6547c73df..326222426 100644
--- a/etc/gnome-calculator.profile
+++ b/etc/gnome-calculator.profile
@@ -11,6 +11,7 @@ include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc 11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc 12include /etc/firejail/disable-programs.inc
13include /etc/firejail/whitelist-common.inc 13include /etc/firejail/whitelist-common.inc
14include /etc/firejail/whitelist-var-common.inc
14 15
15caps.drop all 16caps.drop all
16netfilter 17netfilter
diff --git a/etc/google-earth.profile b/etc/google-earth.profile
new file mode 100644
index 000000000..b60f5b3a5
--- /dev/null
+++ b/etc/google-earth.profile
@@ -0,0 +1,48 @@
1# Firejail profile for google-earth
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/google-earth.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/Google
9noblacklist ${HOME}/.googleearth/Cache/
10noblacklist ${HOME}/.googleearth/Temp/
11noblacklist ${HOME}/.googleearth/myplaces.backup.kml
12noblacklist ${HOME}/.googleearth/myplaces.kml
13
14include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-devel.inc
16include /etc/firejail/disable-passwdmgr.inc
17include /etc/firejail/disable-programs.inc
18
19mkdir ${HOME}/.config/Google
20mkdir ${HOME}/.googleearth/Cache/
21mkdir ${HOME}/.googleearth/Temp/
22mkfile ${HOME}/.googleearth/myplaces.backup.kml
23mkfile ${HOME}/.googleearth/myplaces.kml
24whitelist ${HOME}/.config/Google
25whitelist ${HOME}/.googleearth/Cache/
26whitelist ${HOME}/.googleearth/Temp/
27whitelist ${HOME}/.googleearth/myplaces.backup.kml
28whitelist ${HOME}/.googleearth/myplaces.kml
29include /etc/firejail/whitelist-common.inc
30
31caps.drop all
32ipc-namespace
33netfilter
34nodvd
35nogroups
36nonewprivs
37noroot
38notv
39novideo
40protocol unix,inet,inet6
41seccomp
42shell none
43
44private-bin google-earth,sh,bash,dash,grep,sed,ls,dirname
45private-dev
46
47noexec ${HOME}
48noexec /tmp
diff --git a/etc/gpicview.profile b/etc/gpicview.profile
index 26bc589ee..1842c9cb1 100644
--- a/etc/gpicview.profile
+++ b/etc/gpicview.profile
@@ -12,6 +12,8 @@ include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc 13include /etc/firejail/disable-programs.inc
14 14
15include /etc/firejail/whitelist-var-common.inc
16
15caps.drop all 17caps.drop all
16net none 18net none
17nodvd 19nodvd
diff --git a/etc/handbrake.profile b/etc/handbrake.profile
index 2b33051e2..f5e7bc329 100644
--- a/etc/handbrake.profile
+++ b/etc/handbrake.profile
@@ -12,6 +12,8 @@ include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc 13include /etc/firejail/disable-programs.inc
14 14
15include /etc/firejail/whitelist-var-common.inc
16
15caps.drop all 17caps.drop all
16netfilter 18netfilter
17nogroups 19nogroups
diff --git a/etc/hugin.profile b/etc/hugin.profile
index d3cd181b1..ff88e0d5c 100644
--- a/etc/hugin.profile
+++ b/etc/hugin.profile
@@ -25,6 +25,7 @@ protocol unix
25seccomp 25seccomp
26shell none 26shell none
27 27
28private-bin PTBatcherGUI,calibrate_lens_gui,hugin,hugin_stitch_project,align_image_stack,autooptimiser,celeste_standalone,checkpto,cpclean,cpfind,deghosting_mask,fulla,geocpset,hugin_executor,hugin_hdrmerge,hugin_lensdb,icpfind,linefind,nona,pano_modify,pano_trafo,pto_gen,pto_lensstack,pto_mask,pto_merge,pto_move,pto_template,pto_var,tca_correct,verdandi,vig_optimize,enblend
28private-dev 29private-dev
29private-tmp 30private-tmp
30 31
diff --git a/etc/imagej.profile b/etc/imagej.profile
new file mode 100644
index 000000000..88a56c706
--- /dev/null
+++ b/etc/imagej.profile
@@ -0,0 +1,35 @@
1# Firejail profile for imagej
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/imagej.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.imagej
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17ipc-namespace
18net none
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30private-bin imagej,bash,grep,sort,tail,tr,cut,whoami,hostname,uname,mkdir,ls,touch,free,awk,update-java-alternatives,basename,xprop,rm,ln
31private-dev
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/inkscape.profile b/etc/inkscape.profile
index 1d24f5d7d..c062ab8ef 100644
--- a/etc/inkscape.profile
+++ b/etc/inkscape.profile
@@ -12,6 +12,8 @@ include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc 13include /etc/firejail/disable-programs.inc
14 14
15include /etc/firejail/whitelist-var-common.inc
16
15caps.drop all 17caps.drop all
16netfilter 18netfilter
17nodvd 19nodvd
@@ -25,6 +27,7 @@ protocol unix
25seccomp 27seccomp
26shell none 28shell none
27 29
30#private-bin inkscape
28private-dev 31private-dev
29private-tmp 32private-tmp
30 33
diff --git a/etc/k3b.profile b/etc/k3b.profile
index ca190ecb9..58623d823 100644
--- a/etc/k3b.profile
+++ b/etc/k3b.profile
@@ -14,6 +14,8 @@ include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc 14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc 15include /etc/firejail/disable-programs.inc
16 16
17include /etc/firejail/whitelist-var-common.inc
18
17caps.drop all 19caps.drop all
18no3d 20no3d
19nonewprivs 21nonewprivs
diff --git a/etc/karbon.profile b/etc/karbon.profile
new file mode 100644
index 000000000..3525a3e06
--- /dev/null
+++ b/etc/karbon.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for krita
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/krita.profile
diff --git a/etc/kate.profile b/etc/kate.profile
index ec5d09ce2..69100d49d 100644
--- a/etc/kate.profile
+++ b/etc/kate.profile
@@ -17,6 +17,8 @@ include /etc/firejail/disable-common.inc
17include /etc/firejail/disable-passwdmgr.inc 17include /etc/firejail/disable-passwdmgr.inc
18include /etc/firejail/disable-programs.inc 18include /etc/firejail/disable-programs.inc
19 19
20include /etc/firejail/whitelist-var-common.inc
21
20caps.drop all 22caps.drop all
21netfilter 23netfilter
22nodvd 24nodvd
diff --git a/etc/kcalc.profile b/etc/kcalc.profile
index f334c4c72..0de23f106 100644
--- a/etc/kcalc.profile
+++ b/etc/kcalc.profile
@@ -11,6 +11,8 @@ include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc 11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc 12include /etc/firejail/disable-programs.inc
13 13
14include /etc/firejail/whitelist-var-common.inc
15
14caps.drop all 16caps.drop all
15netfilter 17netfilter
16no3d 18no3d
diff --git a/etc/kdenlive.profile b/etc/kdenlive.profile
new file mode 100644
index 000000000..a1a5f957c
--- /dev/null
+++ b/etc/kdenlive.profile
@@ -0,0 +1,30 @@
1# Firejail profile for kdenlive
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/kdenlive.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15net none
16nodvd
17nogroups
18nonewprivs
19noroot
20notv
21protocol unix,inet,inet6
22seccomp
23shell none
24
25private-bin kdenlive,kdenlive_render,dbus-launch,melt,ffmpeg,ffplay,ffprobe,dvdauthor,genisoimage,vlc,xine,kdeinit5,kshell5,kdeinit5_shutdown,kdeinit5_wrapper,kdeinit4,kshell4,kdeinit4_shutdown,kdeinit4_wrapper
26private-dev
27#private-etc fonts,alternatives,X11,pulse,passwd
28
29noexec ${HOME}
30noexec /tmp
diff --git a/etc/krita.profile b/etc/krita.profile
new file mode 100644
index 000000000..e91f5b242
--- /dev/null
+++ b/etc/krita.profile
@@ -0,0 +1,32 @@
1# Firejail profile for krita
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/krita.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15ipc-namespace
16net none
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix
25seccomp
26shell none
27
28private-dev
29private-tmp
30
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/kwrite.profile b/etc/kwrite.profile
index 6ba076dc0..6b458ede3 100644
--- a/etc/kwrite.profile
+++ b/etc/kwrite.profile
@@ -17,6 +17,8 @@ include /etc/firejail/disable-common.inc
17include /etc/firejail/disable-passwdmgr.inc 17include /etc/firejail/disable-passwdmgr.inc
18include /etc/firejail/disable-programs.inc 18include /etc/firejail/disable-programs.inc
19 19
20include /etc/firejail/whitelist-var-common.inc
21
20caps.drop all 22caps.drop all
21netfilter 23netfilter
22nodvd 24nodvd
diff --git a/etc/leafpad.profile b/etc/leafpad.profile
index e7557651b..c9addba21 100644
--- a/etc/leafpad.profile
+++ b/etc/leafpad.profile
@@ -12,6 +12,8 @@ include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc 13include /etc/firejail/disable-programs.inc
14 14
15include /etc/firejail/whitelist-var-common.inc
16
15caps.drop all 17caps.drop all
16netfilter 18netfilter
17no3d 19no3d
diff --git a/etc/libreoffice.profile b/etc/libreoffice.profile
index ec7356002..8d05a557c 100644
--- a/etc/libreoffice.profile
+++ b/etc/libreoffice.profile
@@ -14,6 +14,8 @@ include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc 14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc 15include /etc/firejail/disable-programs.inc
16 16
17include /etc/firejail/whitelist-var-common.inc
18
17caps.drop all 19caps.drop all
18netfilter 20netfilter
19nodvd 21nodvd
diff --git a/etc/linphone.profile b/etc/linphone.profile
new file mode 100644
index 000000000..41f9245a2
--- /dev/null
+++ b/etc/linphone.profile
@@ -0,0 +1,41 @@
1# Firejail profile for linphone
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/linphone.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.linphone-history.db
9noblacklist ${HOME}/.linphonerc
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16mkfile ${HOME}/.linphone-history.db
17mkfile ${HOME}/.linphonerc
18whitelist ${HOME}/.linphone-history.db
19whitelist ${HOME}/.linphonerc
20whitelist ${HOME}/Downloads
21include /etc/firejail/whitelist-common.inc
22
23caps.drop all
24netfilter
25no3d
26nodvd
27nogroups
28nonewprivs
29noroot
30notv
31novideo
32protocol unix,inet,inet6
33seccomp
34shell none
35
36disable-mnt
37private-dev
38private-tmp
39
40noexec ${HOME}
41noexec /tmp
diff --git a/etc/lmms.profile b/etc/lmms.profile
new file mode 100644
index 000000000..29ed235c6
--- /dev/null
+++ b/etc/lmms.profile
@@ -0,0 +1,34 @@
1# Firejail profile for lmms
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/lmms.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.lmmsrc.xml
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17ipc-namespace
18net none
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30private-dev
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/luminance-hdr.profile b/etc/luminance-hdr.profile
index bd32e0c70..ec2a65290 100644
--- a/etc/luminance-hdr.profile
+++ b/etc/luminance-hdr.profile
@@ -26,6 +26,7 @@ seccomp
26shell none 26shell none
27tracelog 27tracelog
28 28
29#private-bin luminance-hdr,luminance-hdr-cli,align_image_stack
29private-dev 30private-dev
30private-tmp 31private-tmp
31 32
diff --git a/etc/macrofusion.profile b/etc/macrofusion.profile
new file mode 100644
index 000000000..be66cf6ee
--- /dev/null
+++ b/etc/macrofusion.profile
@@ -0,0 +1,35 @@
1# Firejail profile for macrofusion
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/macrofusion.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.config/mfusion
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17ipc-namespace
18net none
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30#private-bin python3,macrofusion,env,enfuse,exiftool,align_image_stack
31private-dev
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/mousepad.profile b/etc/mousepad.profile
index 36365fc2f..60205ffda 100644
--- a/etc/mousepad.profile
+++ b/etc/mousepad.profile
@@ -12,6 +12,8 @@ include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc 13include /etc/firejail/disable-programs.inc
14 14
15include /etc/firejail/whitelist-var-common.inc
16
15caps.drop all 17caps.drop all
16netfilter 18netfilter
17nodvd 19nodvd
diff --git a/etc/mpd.profile b/etc/mpd.profile
new file mode 100644
index 000000000..7bfa47d77
--- /dev/null
+++ b/etc/mpd.profile
@@ -0,0 +1,33 @@
1# Firejail profile for mpd
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/mpd.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.mpdconf
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17netfilter
18no3d
19nodvd
20nonewprivs
21noroot
22notv
23novideo
24protocol unix,inet,inet6
25seccomp
26shell none
27
28#private-bin mpd,bash
29private-dev
30private-tmp
31
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/mpv.profile b/etc/mpv.profile
index 0592751ef..eb8a88a4b 100644
--- a/etc/mpv.profile
+++ b/etc/mpv.profile
@@ -13,6 +13,8 @@ include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc 14include /etc/firejail/disable-programs.inc
15 15
16include /etc/firejail/whitelist-var-common.inc
17
16caps.drop all 18caps.drop all
17netfilter 19netfilter
18nogroups 20nogroups
diff --git a/etc/musescore.profile b/etc/musescore.profile
index 3b5a0b13c..b039d07b2 100644
--- a/etc/musescore.profile
+++ b/etc/musescore.profile
@@ -19,6 +19,7 @@ caps.drop all
19netfilter 19netfilter
20no3d 20no3d
21nodvd 21nodvd
22nogroups
22nonewprivs 23nonewprivs
23noroot 24noroot
24notv 25notv
diff --git a/etc/natron.profile b/etc/natron.profile
new file mode 100644
index 000000000..d77539d83
--- /dev/null
+++ b/etc/natron.profile
@@ -0,0 +1,33 @@
1# Firejail profile for natron
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/natron.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.Natron
10noblacklist ${HOME}/.cache/INRIA/Natron
11noblacklist ${HOME}/.config/INRIA
12noblacklist /opt/natron
13
14include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-devel.inc
16include /etc/firejail/disable-passwdmgr.inc
17include /etc/firejail/disable-programs.inc
18
19caps.drop all
20netfilter
21nodvd
22nogroups
23nonewprivs
24noroot
25notv
26protocol unix,inet,inet6
27seccomp
28shell none
29
30private-bin natron,Natron,NatronRenderer
31
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/okular.profile b/etc/okular.profile
index 5a704ad26..94736fbae 100644
--- a/etc/okular.profile
+++ b/etc/okular.profile
@@ -20,6 +20,8 @@ include /etc/firejail/disable-devel.inc
20include /etc/firejail/disable-passwdmgr.inc 20include /etc/firejail/disable-passwdmgr.inc
21include /etc/firejail/disable-programs.inc 21include /etc/firejail/disable-programs.inc
22 22
23include /etc/firejail/whitelist-var-common.inc
24
23caps.drop all 25caps.drop all
24netfilter 26netfilter
25nodvd 27nodvd
diff --git a/etc/pidgin.profile b/etc/pidgin.profile
index dd610920a..d195cf586 100644
--- a/etc/pidgin.profile
+++ b/etc/pidgin.profile
@@ -27,3 +27,6 @@ tracelog
27private-bin pidgin 27private-bin pidgin
28private-dev 28private-dev
29private-tmp 29private-tmp
30
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/ricochet.profile b/etc/ricochet.profile
new file mode 100644
index 000000000..6da0e21d5
--- /dev/null
+++ b/etc/ricochet.profile
@@ -0,0 +1,40 @@
1# Firejail profile for ricochet
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/ricochet.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.local/share/Ricochet
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16whitelist ${DOWNLOADS}
17whitelist ${HOME}/.local/share/Ricochet
18include /etc/firejail/whitelist-common.inc
19
20caps.drop all
21ipc-namespace
22netfilter
23no3d
24nodvd
25nogroups
26nonewprivs
27noroot
28notv
29novideo
30protocol unix,inet,inet6
31seccomp
32shell none
33
34disable-mnt
35private-bin ricochet,tor
36private-dev
37#private-etc fonts,tor,X11,alternatives
38
39noexec ${HOME}
40noexec /tmp
diff --git a/etc/riot-web.profile b/etc/riot-web.profile
index c714652df..06dbbe9d9 100644
--- a/etc/riot-web.profile
+++ b/etc/riot-web.profile
@@ -5,9 +5,9 @@ include /etc/firejail/riot-web.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include /etc/firejail/globals.local
7 7
8noblacklist ~/.config/Riot 8noblacklist ${HOME}/.config/Riot
9 9
10whitelist ~/.config/Riot 10whitelist ${HOME}/.config/Riot
11include /etc/firejail/whitelist-common.inc 11include /etc/firejail/whitelist-common.inc
12 12
13# Redirect 13# Redirect
diff --git a/etc/rocketchat.profile b/etc/rocketchat.profile
new file mode 100644
index 000000000..da92cd938
--- /dev/null
+++ b/etc/rocketchat.profile
@@ -0,0 +1,14 @@
1# Firejail profile for rocketchat
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/rocketchat.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/Rocket.Chat
9
10whitelist ${HOME}/.config/Rocket.Chat
11include /etc/firejail/whitelist-common.inc
12
13# Redirect
14include /etc/firejail/electron.profile
diff --git a/etc/scribus.profile b/etc/scribus.profile
index e4c88be49..dd06fa59f 100644
--- a/etc/scribus.profile
+++ b/etc/scribus.profile
@@ -38,5 +38,6 @@ protocol unix
38seccomp 38seccomp
39tracelog 39tracelog
40 40
41#private-bin scribus,gs
41private-dev 42private-dev
42# private-tmp 43# private-tmp
diff --git a/etc/shotcut.profile b/etc/shotcut.profile
new file mode 100644
index 000000000..e30bc1f46
--- /dev/null
+++ b/etc/shotcut.profile
@@ -0,0 +1,31 @@
1# Firejail profile for shotcut
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/shotcut.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.config/Meltytech
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17net none
18nodvd
19nogroups
20nonewprivs
21noroot
22notv
23protocol unix
24seccomp
25shell none
26
27#private-bin shotcut,melt,qmelt,nice
28private-dev
29
30noexec ${HOME}
31noexec /tmp
diff --git a/etc/silentarmy.profile b/etc/silentarmy.profile
index abc68a499..977cfea99 100644
--- a/etc/silentarmy.profile
+++ b/etc/silentarmy.profile
@@ -11,6 +11,8 @@ include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-passwdmgr.inc 11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc 12include /etc/firejail/disable-programs.inc
13 13
14include /etc/firejail/whitelist-var-common.inc
15
14caps.drop all 16caps.drop all
15netfilter 17netfilter
16nodvd 18nodvd
@@ -28,6 +30,7 @@ disable-mnt
28private 30private
29# private-bin silentarmy,sa-solver,python3 31# private-bin silentarmy,sa-solver,python3
30private-dev 32private-dev
33private-opt none
31private-tmp 34private-tmp
32 35
33noexec ${HOME} 36noexec ${HOME}
diff --git a/etc/skype.profile b/etc/skype.profile
index f3e504a3f..b12f9879e 100644
--- a/etc/skype.profile
+++ b/etc/skype.profile
@@ -24,6 +24,7 @@ seccomp
24shell none 24shell none
25 25
26disable-mnt 26disable-mnt
27#private-bin skype,bash
27private-dev 28private-dev
28private-tmp 29private-tmp
29 30
diff --git a/etc/ssh-agent.profile b/etc/ssh-agent.profile
index 7e9d34c92..fa5728d9b 100644
--- a/etc/ssh-agent.profile
+++ b/etc/ssh-agent.profile
@@ -16,6 +16,7 @@ include /etc/firejail/disable-common.inc
16include /etc/firejail/disable-passwdmgr.inc 16include /etc/firejail/disable-passwdmgr.inc
17include /etc/firejail/disable-programs.inc 17include /etc/firejail/disable-programs.inc
18 18
19shell none
19caps.drop all 20caps.drop all
20netfilter 21netfilter
21no3d 22no3d
diff --git a/etc/steam.profile b/etc/steam.profile
index 227162e1f..b4b9ede70 100644
--- a/etc/steam.profile
+++ b/etc/steam.profile
@@ -21,6 +21,8 @@ noblacklist ${HOME}/.steampath
21noblacklist ${HOME}/.steampid 21noblacklist ${HOME}/.steampid
22# with >=llvm-4 mesa drivers need llvm stuff 22# with >=llvm-4 mesa drivers need llvm stuff
23noblacklist /usr/lib/llvm* 23noblacklist /usr/lib/llvm*
24# needed for STEAM_RUNTIME_PREFER_HOST_LIBRARIES=1 to work
25noblacklist /sbin
24 26
25include /etc/firejail/disable-common.inc 27include /etc/firejail/disable-common.inc
26include /etc/firejail/disable-devel.inc 28include /etc/firejail/disable-devel.inc
@@ -44,5 +46,5 @@ shell none
44 46
45# private-dev should be commented for controllers 47# private-dev should be commented for controllers
46private-dev 48private-dev
47private-etc asound.conf,ca-certificates,dbus-1,drirc,fonts,group,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.preload,localtime,lsb-release,machine-id,mime.types,passwd,pulse,resolv.conf,ssl 49private-etc asound.conf,ca-certificates,dbus-1,drirc,fonts,group,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.preload,ld.so.conf,ld.so.conf.d,localtime,lsb-release,machine-id,mime.types,passwd,pulse,resolv.conf,ssl
48private-tmp 50private-tmp
diff --git a/etc/surf.profile b/etc/surf.profile
new file mode 100644
index 000000000..251331902
--- /dev/null
+++ b/etc/surf.profile
@@ -0,0 +1,35 @@
1# Firejail profile for surf
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/surf.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.surf
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-programs.inc
13
14mkdir ~/.surf
15whitelist ${DOWNLOADS}
16include /etc/firejail/whitelist-common.inc
17
18caps.drop all
19netfilter
20nodvd
21nonewprivs
22noroot
23notv
24protocol unix,inet,inet6,netlink
25seccomp
26shell none
27tracelog
28
29private-bin ls,surf,sh,dash,bash,curl,dmenu,printf,sed,sleep,st,stterm,xargs,xprop
30private-dev
31private-etc passwd,group,hosts,resolv.conf,fonts,ssl
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/synfigstudio.profile b/etc/synfigstudio.profile
index 08ece1e9b..b0014ace6 100644
--- a/etc/synfigstudio.profile
+++ b/etc/synfigstudio.profile
@@ -26,6 +26,7 @@ protocol unix
26seccomp 26seccomp
27shell none 27shell none
28 28
29#private-bin synfigstudio
29private-dev 30private-dev
30private-tmp 31private-tmp
31 32
diff --git a/etc/teamspeak3.profile b/etc/teamspeak3.profile
new file mode 100644
index 000000000..86f96ba50
--- /dev/null
+++ b/etc/teamspeak3.profile
@@ -0,0 +1,39 @@
1# Firejail profile for teamspeak3
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/teamspeak3.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.ts3client
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ${HOME}/.ts3client
16whitelist ${DOWNLOADS}
17whitelist ${HOME}/.ts3client
18include /etc/firejail/whitelist-common.inc
19
20caps.drop all
21ipc-namespace
22netfilter
23no3d
24nodvd
25nogroups
26nonewprivs
27noroot
28notv
29novideo
30protocol unix,inet,inet6
31seccomp
32shell none
33
34disable-mnt
35private-dev
36private-tmp
37
38noexec ${HOME}
39noexec /tmp
diff --git a/etc/terasology.profile b/etc/terasology.profile
new file mode 100644
index 000000000..ca580c0d0
--- /dev/null
+++ b/etc/terasology.profile
@@ -0,0 +1,42 @@
1# Firejail profile for terasology
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/default.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.java
10noblacklist ${HOME}/.local/share/terasology
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17mkdir ${HOME}/.java
18mkdir ${HOME}/.local/share/terasology
19whitelist ${HOME}/.java
20whitelist ${HOME}/.local/share/terasology
21include /etc/firejail/whitelist-common.inc
22
23caps.drop all
24ipc-namespace
25net none
26netfilter
27nodvd
28nogroups
29nonewprivs
30noroot
31notv
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36
37disable-mnt
38private-dev
39private-etc asound.conf,ca-certificates,dbus-1,drirc,fonts,group,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.preload,localtime,lsb-release,machine-id,mime.types,passwd,pulse,resolv.conf,ssl,java-8-openjdk,java-7-openjdk
40private-tmp
41
42noexec ${HOME}
diff --git a/etc/tor-browser-en.profile b/etc/tor-browser-en.profile
new file mode 100644
index 000000000..bf3a80139
--- /dev/null
+++ b/etc/tor-browser-en.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/torbrowser-launcher.profile
diff --git a/etc/tor.profile b/etc/tor.profile
new file mode 100644
index 000000000..fcb123eef
--- /dev/null
+++ b/etc/tor.profile
@@ -0,0 +1,47 @@
1# Firejail profile for tor
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/tor.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# How to use:
9# Create a script called anything (e.g. mytor)
10# with the following contents:
11
12# #!/bin/bash
13# TORCMD="tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 1"
14# sudo -b daemon -f -d -- firejail --profile=/home/<username>/.config/firejail/tor.profile $TORCMD
15
16# You'll also likely want to disable the system service (if it exists)
17# Run mytor (or whatever you called the script above) whenever you want to start tor
18
19include /etc/firejail/disable-common.inc
20include /etc/firejail/disable-devel.inc
21include /etc/firejail/disable-passwdmgr.inc
22include /etc/firejail/disable-programs.inc
23
24caps.keep setuid,setgid,net_bind_service,dac_read_search
25ipc-namespace
26netfilter
27no3d
28nodvd
29nogroups
30nonewprivs
31nosound
32notv
33novideo
34protocol unix,inet,inet6
35seccomp
36shell none
37writable-var
38
39disable-mnt
40private
41private-bin tor,bash
42private-dev
43private-etc tor,passwd
44private-tmp
45
46noexec ${HOME}
47noexec /tmp
diff --git a/etc/torbrowser-launcher.profile b/etc/torbrowser-launcher.profile
index 763c2d051..3b6b65bec 100644
--- a/etc/torbrowser-launcher.profile
+++ b/etc/torbrowser-launcher.profile
@@ -5,17 +5,20 @@ include /etc/firejail/torbrowser-launcher.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include /etc/firejail/globals.local
7 7
8 8noblacklist ~/.tor-browser-en
9noblacklist ~/.config/torbrowser 9noblacklist ~/.config/torbrowser
10whitelist ~/.config/torbrowser
11noblacklist ~/.local/share/torbrowser 10noblacklist ~/.local/share/torbrowser
12whitelist ~/.local/share/torbrowser
13 11
14include /etc/firejail/disable-common.inc 12include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-devel.inc 13include /etc/firejail/disable-devel.inc
16include /etc/firejail/disable-passwdmgr.inc 14include /etc/firejail/disable-passwdmgr.inc
17include /etc/firejail/disable-programs.inc 15include /etc/firejail/disable-programs.inc
18 16
17whitelist ~/.tor-browser-en
18whitelist ~/.config/torbrowser
19whitelist ~/.local/share/torbrowser
20include /etc/firejail/whitelist-common.inc
21
19caps.drop all 22caps.drop all
20netfilter 23netfilter
21nodvd 24nodvd
@@ -29,7 +32,7 @@ seccomp
29shell none 32shell none
30tracelog 33tracelog
31 34
32private-bin torbrowser-launcher,python2.7,python,bash,dash,sh,grep,tail,env,gpg,id,readlink,dirname,test,mkdir,ln,sed,cp,rm,getconf 35private-bin bash,cp,dash,dirname,env,expr,file,getconf,gpg,grep,id,ln,mkdir,python,python2.7,readlink,rm,sed,sh,tail,test,tor-browser-en,torbrowser-launcher
33private-dev 36private-dev
34private-etc fonts 37private-etc fonts
35private-tmp 38private-tmp
diff --git a/etc/transmission-gtk.profile b/etc/transmission-gtk.profile
index 0bb721c64..6a8d6c679 100644
--- a/etc/transmission-gtk.profile
+++ b/etc/transmission-gtk.profile
@@ -19,6 +19,7 @@ whitelist ${DOWNLOADS}
19whitelist ~/.cache/transmission 19whitelist ~/.cache/transmission
20whitelist ~/.config/transmission 20whitelist ~/.config/transmission
21include /etc/firejail/whitelist-common.inc 21include /etc/firejail/whitelist-common.inc
22include /etc/firejail/whitelist-var-common.inc
22 23
23caps.drop all 24caps.drop all
24netfilter 25netfilter
diff --git a/etc/transmission-qt.profile b/etc/transmission-qt.profile
index 08964bbab..4db8e19ce 100644
--- a/etc/transmission-qt.profile
+++ b/etc/transmission-qt.profile
@@ -19,6 +19,7 @@ whitelist ${DOWNLOADS}
19whitelist ~/.cache/transmission 19whitelist ~/.cache/transmission
20whitelist ~/.config/transmission 20whitelist ~/.config/transmission
21include /etc/firejail/whitelist-common.inc 21include /etc/firejail/whitelist-common.inc
22include /etc/firejail/whitelist-var-common.inc
22 23
23caps.drop all 24caps.drop all
24netfilter 25netfilter
diff --git a/etc/tuxguitar.profile b/etc/tuxguitar.profile
index 5b6a257f6..fbc198cc3 100644
--- a/etc/tuxguitar.profile
+++ b/etc/tuxguitar.profile
@@ -17,6 +17,7 @@ caps.drop all
17netfilter 17netfilter
18no3d 18no3d
19nodvd 19nodvd
20nogroups
20nonewprivs 21nonewprivs
21noroot 22noroot
22notv 23notv
diff --git a/etc/virtualbox.profile b/etc/virtualbox.profile
index 6e153d559..b01e6d144 100644
--- a/etc/virtualbox.profile
+++ b/etc/virtualbox.profile
@@ -20,7 +20,9 @@ mkdir ~/.config/VirtualBox
20mkdir ~/VirtualBox VMs 20mkdir ~/VirtualBox VMs
21whitelist ~/.config/VirtualBox 21whitelist ~/.config/VirtualBox
22whitelist ~/VirtualBox VMs 22whitelist ~/VirtualBox VMs
23whitelist ${DOWNLOADS}
23include /etc/firejail/whitelist-common.inc 24include /etc/firejail/whitelist-common.inc
25include /etc/firejail/whitelist-var-common.inc
24 26
25caps.drop all 27caps.drop all
26netfilter 28netfilter
diff --git a/etc/vlc.profile b/etc/vlc.profile
index bccde7a3d..c3a4d58d0 100644
--- a/etc/vlc.profile
+++ b/etc/vlc.profile
@@ -12,6 +12,8 @@ include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc 13include /etc/firejail/disable-programs.inc
14 14
15include /etc/firejail/whitelist-var-common.inc
16
15caps.drop all 17caps.drop all
16netfilter 18netfilter
17# nogroups 19# nogroups
diff --git a/etc/whitelist-common.inc b/etc/whitelist-common.inc
index ba4b91451..310149ecd 100644
--- a/etc/whitelist-common.inc
+++ b/etc/whitelist-common.inc
@@ -16,6 +16,7 @@ whitelist ~/.drirc
16whitelist ~/.mime.types 16whitelist ~/.mime.types
17whitelist ~/.local/share/applications 17whitelist ~/.local/share/applications
18read-only ~/.local/share/applications 18read-only ~/.local/share/applications
19whitelist ~/.config/ibus
19 20
20# fonts 21# fonts
21whitelist ~/.fonts 22whitelist ~/.fonts
@@ -34,10 +35,14 @@ whitelist ~/.gtkrc-2.0
34whitelist ~/.gtk-2.0 35whitelist ~/.gtk-2.0
35whitelist ~/.config/gtk-2.0 36whitelist ~/.config/gtk-2.0
36whitelist ~/.config/gtk-3.0 37whitelist ~/.config/gtk-3.0
38whitelist ~/.config/gtkrc
39whitelist ~/.config/gtkrc-2.0
37whitelist ~/.themes 40whitelist ~/.themes
38whitelist ~/.local/share/themes 41whitelist ~/.local/share/themes
39whitelist ~/.kde/share/config/gtkrc 42whitelist ~/.kde/share/config/gtkrc
40whitelist ~/.kde/share/config/gtkrc-2.0 43whitelist ~/.kde/share/config/gtkrc-2.0
44whitelist ~/.kde4/share/config/gtkrc
45whitelist ~/.kde4/share/config/gtkrc-2.0
41whitelist ~/.gnome2 46whitelist ~/.gnome2
42whitelist ~/.gnome2-private 47whitelist ~/.gnome2-private
43 48
@@ -50,3 +55,6 @@ whitelist ~/.config/kdeglobals
50whitelist ~/.kde/share/config/oxygenrc 55whitelist ~/.kde/share/config/oxygenrc
51whitelist ~/.kde/share/config/kdeglobals 56whitelist ~/.kde/share/config/kdeglobals
52whitelist ~/.kde/share/icons 57whitelist ~/.kde/share/icons
58whitelist ~/.kde4/share/config/oxygenrc
59whitelist ~/.kde4/share/config/kdeglobals
60whitelist ~/.kde4/share/icons
diff --git a/etc/whitelist-var-common.inc b/etc/whitelist-var-common.inc
new file mode 100644
index 000000000..024995f20
--- /dev/null
+++ b/etc/whitelist-var-common.inc
@@ -0,0 +1,11 @@
1# Local customizations come here
2include /etc/firejail/whitelist-var-common.local
3
4# common /var whitelist for all profiles
5
6whitelist /var/lib/dbus
7whitelist /var/lib/menu-xdg
8whitelist /var/cache/fontconfig
9whitelist /var/tmp
10whitelist /var/run
11whitelist /var/lock
diff --git a/etc/x-terminal-emulator.profile b/etc/x-terminal-emulator.profile
new file mode 100644
index 000000000..1395b81c9
--- /dev/null
+++ b/etc/x-terminal-emulator.profile
@@ -0,0 +1,20 @@
1# Firejail profile for x-terminal-emulator
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/x-terminal-emulator.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9caps.drop all
10ipc-namespace
11net none
12netfilter
13nogroups
14noroot
15protocol unix
16seccomp
17
18private-dev
19
20noexec /tmp
diff --git a/etc/xmr-stak-cpu.profile b/etc/xmr-stak-cpu.profile
new file mode 100644
index 000000000..9cc6e0c1f
--- /dev/null
+++ b/etc/xmr-stak-cpu.profile
@@ -0,0 +1,42 @@
1# Firejail profile for xmr-stak-cpu
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/xmr-stak-cpu.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17ipc-namespace
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix,inet,inet6
28seccomp
29shell none
30
31disable-mnt
32private
33private-bin xmr-stak-cpu
34private-dev
35private-etc xmr-stak-cpu.json
36private-lib
37private-opt none
38private-tmp
39
40memory-deny-write-execute
41noexec ${HOME}
42noexec /tmp
diff --git a/etc/youtube-dl.profile b/etc/youtube-dl.profile
index e20fb3e99..d41591fd6 100644
--- a/etc/youtube-dl.profile
+++ b/etc/youtube-dl.profile
@@ -13,6 +13,8 @@ include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc 14include /etc/firejail/disable-programs.inc
15 15
16include /etc/firejail/whitelist-var-common.inc
17
16caps.drop all 18caps.drop all
17ipc-namespace 19ipc-namespace
18netfilter 20netfilter
diff --git a/etc/zart.profile b/etc/zart.profile
new file mode 100644
index 000000000..6e136d0c9
--- /dev/null
+++ b/etc/zart.profile
@@ -0,0 +1,30 @@
1# Firejail profile for zart
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/zart.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15ipc-namespace
16net none
17nodvd
18nogroups
19nonewprivs
20noroot
21notv
22protocol unix
23seccomp
24shell none
25
26private-bin zart,ffmpeg,melt,ffprobe,ffplay
27private-dev
28
29noexec ${HOME}
30noexec /tmp
diff --git a/platform/debian/conffiles b/platform/debian/conffiles
index d0e236e61..af6547f7f 100644
--- a/platform/debian/conffiles
+++ b/platform/debian/conffiles
@@ -357,3 +357,4 @@
357/etc/firejail/zoom.profile 357/etc/firejail/zoom.profile
358/etc/firejail/yandex-browser.profile 358/etc/firejail/yandex-browser.profile
359/etc/firejail/itch.profile 359/etc/firejail/itch.profile
360/etc/firejail/whitelist-var-common.inc
diff --git a/src/fbuilder/Makefile.in b/src/fbuilder/Makefile.in
new file mode 100644
index 000000000..dd8e2ce6e
--- /dev/null
+++ b/src/fbuilder/Makefile.in
@@ -0,0 +1,45 @@
1all: fbuilder
2
3CC=@CC@
4prefix=@prefix@
5exec_prefix=@exec_prefix@
6libdir=@libdir@
7sysconfdir=@sysconfdir@
8
9VERSION=@PACKAGE_VERSION@
10NAME=@PACKAGE_NAME@
11HAVE_SECCOMP_H=@HAVE_SECCOMP_H@
12HAVE_SECCOMP=@HAVE_SECCOMP@
13HAVE_CHROOT=@HAVE_CHROOT@
14HAVE_BIND=@HAVE_BIND@
15HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
16HAVE_NETWORK=@HAVE_NETWORK@
17HAVE_USERNS=@HAVE_USERNS@
18HAVE_X11=@HAVE_X11@
19HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@
20HAVE_WHITELIST=@HAVE_WHITELIST@
21HAVE_GLOBALCFG=@HAVE_GLOBALCFG@
22HAVE_APPARMOR=@HAVE_APPARMOR@
23HAVE_OVERLAYFS=@HAVE_OVERLAYFS@
24HAVE_PRIVATE_HOME=@HAVE_PRIVATE_HOME@
25EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
26HAVE_GCOV=@HAVE_GCOV@
27EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
28
29H_FILE_LIST = $(sort $(wildcard *.[h]))
30C_FILE_LIST = $(sort $(wildcard *.c))
31OBJS = $(C_FILE_LIST:.c=.o)
32BINOBJS = $(foreach file, $(OBJS), $file)
33CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_X11) $(HAVE_PRIVATE_HOME) $(HAVE_APPARMOR) $(HAVE_OVERLAYFS) $(HAVE_SECCOMP) $(HAVE_GLOBALCFG) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_BIND) $(HAVE_FILE_TRANSFER) $(HAVE_WHITELIST) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
34LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
35
36%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/syscall.h
37 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
38
39fbuilder: $(OBJS)
40 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS)
41
42clean:; rm -f *.o fbuilder *.gcov *.gcda *.gcno
43
44distclean: clean
45 rm -fr Makefile
diff --git a/src/fbuilder/build_bin.c b/src/fbuilder/build_bin.c
new file mode 100644
index 000000000..7d0e2cb7c
--- /dev/null
+++ b/src/fbuilder/build_bin.c
@@ -0,0 +1,121 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "fbuilder.h"
21
22static FileDB *bin_out = NULL;
23
24static void process_bin(const char *fname) {
25 assert(fname);
26
27 // process trace file
28 FILE *fp = fopen(fname, "r");
29 if (!fp) {
30 fprintf(stderr, "Error: cannot open %s\n", fname);
31 exit(1);
32 }
33
34 char buf[MAX_BUF];
35 while (fgets(buf, MAX_BUF, fp)) {
36 // remove \n
37 char *ptr = strchr(buf, '\n');
38 if (ptr)
39 *ptr = '\0';
40
41 // parse line: 4:galculator:access /etc/fonts/conf.d:0
42 // number followed by :
43 ptr = buf;
44 if (!isdigit(*ptr))
45 continue;
46 while (isdigit(*ptr))
47 ptr++;
48 if (*ptr != ':')
49 continue;
50 ptr++;
51
52 // next :
53 ptr = strchr(ptr, ':');
54 if (!ptr)
55 continue;
56 ptr++;
57 if (strncmp(ptr, "exec ", 5) == 0)
58 ptr += 5;
59 else
60 continue;
61 if (strncmp(ptr, "/bin/", 5) == 0)
62 ptr += 5;
63 else if (strncmp(ptr, "/sbin/", 6) == 0)
64 ptr += 6;
65 else if (strncmp(ptr, "/usr/bin/", 9) == 0)
66 ptr += 9;
67 else if (strncmp(ptr, "/usr/sbin/", 10) == 0)
68 ptr += 10;
69 else if (strncmp(ptr, "/usr/local/bin/", 15) == 0)
70 ptr += 15;
71 else if (strncmp(ptr, "/usr/local/sbin/", 16) == 0)
72 ptr += 16;
73 else if (strncmp(ptr, "/usr/games/", 11) == 0)
74 ptr += 12;
75 else if (strncmp(ptr, "/usr/local/games/", 17) == 0)
76 ptr += 17;
77 else
78 continue;
79
80 // end of filename
81 char *ptr2 = strchr(ptr, ':');
82 if (!ptr2)
83 continue;
84 *ptr2 = '\0';
85
86 bin_out = filedb_add(bin_out, ptr);
87 }
88
89 fclose(fp);
90}
91
92
93// process fname, fname.1, fname.2, fname.3, fname.4, fname.5
94void build_bin(const char *fname) {
95 assert(fname);
96
97 // run fname
98 process_bin(fname);
99
100 // run all the rest
101 struct stat s;
102 int i;
103 for (i = 1; i <= 5; i++) {
104 char *newname;
105 if (asprintf(&newname, "%s.%d", fname, i) == -1)
106 errExit("asprintf");
107 if (stat(newname, &s) == 0)
108 process_bin(newname);
109 free(newname);
110 }
111
112 if (bin_out) {
113 printf("# private-bin ");
114 FileDB *ptr = bin_out;
115 while (ptr) {
116 printf("%s,", ptr->fname);
117 ptr = ptr->next;
118 }
119 printf("\n");
120 }
121}
diff --git a/src/fbuilder/build_fs.c b/src/fbuilder/build_fs.c
new file mode 100644
index 000000000..dcd86e069
--- /dev/null
+++ b/src/fbuilder/build_fs.c
@@ -0,0 +1,280 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#include "fbuilder.h"
22
23// common file processing function, using the callback for each line in the file
24static void process_file(const char *fname, const char *dir, void (*callback)(char *)) {
25 assert(fname);
26 assert(dir);
27 assert(callback);
28
29 int dir_len = strlen(dir);
30
31 // process trace file
32 FILE *fp = fopen(fname, "r");
33 if (!fp) {
34 fprintf(stderr, "Error: cannot open %s\n", fname);
35 exit(1);
36 }
37
38 char buf[MAX_BUF];
39 while (fgets(buf, MAX_BUF, fp)) {
40 // remove \n
41 char *ptr = strchr(buf, '\n');
42 if (ptr)
43 *ptr = '\0';
44
45 // parse line: 4:galculator:access /etc/fonts/conf.d:0
46 // number followed by :
47 ptr = buf;
48 if (!isdigit(*ptr))
49 continue;
50 while (isdigit(*ptr))
51 ptr++;
52 if (*ptr != ':')
53 continue;
54 ptr++;
55
56 // next :
57 ptr = strchr(ptr, ':');
58 if (!ptr)
59 continue;
60 ptr++;
61 if (strncmp(ptr, "access ", 7) == 0)
62 ptr += 7;
63 else if (strncmp(ptr, "fopen ", 6) == 0)
64 ptr += 6;
65 else if (strncmp(ptr, "fopen64 ", 8) == 0)
66 ptr += 8;
67 else if (strncmp(ptr, "open64 ", 7) == 0)
68 ptr += 7;
69 else if (strncmp(ptr, "open ", 5) == 0)
70 ptr += 5;
71 else
72 continue;
73 if (strncmp(ptr, dir, dir_len) != 0)
74 continue;
75
76 // end of filename
77 char *ptr2 = strchr(ptr, ':');
78 if (!ptr2)
79 continue;
80 *ptr2 = '\0';
81
82 callback(ptr);
83 }
84
85 fclose(fp);
86}
87
88// process fname, fname.1, fname.2, fname.3, fname.4, fname.5
89static void process_files(const char *fname, const char *dir, void (*callback)(char *)) {
90 assert(fname);
91 assert(dir);
92 assert(callback);
93
94 // run fname
95 process_file(fname, dir, callback);
96
97 // run all the rest
98 struct stat s;
99 int i;
100 for (i = 1; i <= 5; i++) {
101 char *newname;
102 if (asprintf(&newname, "%s.%d", fname, i) == -1)
103 errExit("asprintf");
104 if (stat(newname, &s) == 0)
105 process_file(newname, dir, callback);
106 free(newname);
107 }
108}
109
110//*******************************************
111// etc directory
112//*******************************************
113static FileDB *etc_out = NULL;
114
115static void etc_callback(char *ptr) {
116 // skip firejail directory
117 if (strncmp(ptr, "/etc/firejail", 13) == 0)
118 return;
119
120 // add only top files and directories
121 ptr += 5; // skip "/etc/"
122 char *end = strchr(ptr, '/');
123 if (end)
124 *end = '\0';
125 etc_out = filedb_add(etc_out, ptr);
126}
127
128void build_etc(const char *fname) {
129 assert(fname);
130
131 process_files(fname, "/etc", etc_callback);
132
133 printf("private-etc ");
134 if (etc_out == NULL)
135 printf("none\n");
136 else {
137 FileDB *ptr = etc_out;
138 while (ptr) {
139 printf("%s,", ptr->fname);
140 ptr = ptr->next;
141 }
142 printf("\n");
143 }
144}
145
146//*******************************************
147// var directory
148//*******************************************
149static FileDB *var_out = NULL;
150static void var_callback(char *ptr) {
151 if (strcmp(ptr, "/var/lib") == 0)
152 ;
153 else if (strcmp(ptr, "/var/cache") == 0)
154 ;
155 else if (strncmp(ptr, "/var/lib/menu-xdg", 17) == 0)
156 var_out = filedb_add(var_out, "/var/lib/menu-xdg");
157 else if (strncmp(ptr, "/var/cache/fontconfig", 21) == 0)
158 var_out = filedb_add(var_out, "/var/cache/fontconfig");
159 else
160 var_out = filedb_add(var_out, ptr);
161}
162
163void build_var(const char *fname) {
164 assert(fname);
165
166 process_files(fname, "/var", var_callback);
167
168 if (var_out == NULL)
169 printf("blacklist /var\n");
170 else
171 filedb_print(var_out, "whitelist ");
172}
173
174//*******************************************
175// tmp directory
176//*******************************************
177static FileDB *tmp_out = NULL;
178static void tmp_callback(char *ptr) {
179 filedb_add(tmp_out, ptr);
180}
181
182void build_tmp(const char *fname) {
183 assert(fname);
184
185 process_files(fname, "/tmp", tmp_callback);
186
187 if (tmp_out == NULL)
188 printf("private-tmp\n");
189 else {
190 printf("\n");
191 printf("# private-tmp\n");
192 printf("# File accessed in /tmp directory:\n");
193 printf("# ");
194 FileDB *ptr = tmp_out;
195 while (ptr) {
196 printf("%s,", ptr->fname);
197 ptr = ptr->next;
198 }
199 printf("\n");
200 }
201}
202
203//*******************************************
204// dev directory
205//*******************************************
206static char *dev_skip[] = {
207 "/dev/zero",
208 "/dev/null",
209 "/dev/full",
210 "/dev/random",
211 "/dev/urandom",
212 "/dev/tty",
213 "/dev/snd",
214 "/dev/dri",
215 "/dev/pts",
216 "/dev/nvidia0",
217 "/dev/nvidia1",
218 "/dev/nvidia2",
219 "/dev/nvidia3",
220 "/dev/nvidia4",
221 "/dev/nvidia5",
222 "/dev/nvidia6",
223 "/dev/nvidia7",
224 "/dev/nvidia8",
225 "/dev/nvidia9",
226 "/dev/nvidiactl",
227 "/dev/nvidia-modeset",
228 "/dev/nvidia-uvm",
229 "/dev/video0",
230 "/dev/video1",
231 "/dev/video2",
232 "/dev/video3",
233 "/dev/video4",
234 "/dev/video5",
235 "/dev/video6",
236 "/dev/video7",
237 "/dev/video8",
238 "/dev/video9",
239 "/dev/dvb",
240 "/dev/sr0",
241 NULL
242};
243
244static FileDB *dev_out = NULL;
245static void dev_callback(char *ptr) {
246 // skip private-dev devices
247 int i = 0;
248 int found = 0;
249 while (dev_skip[i]) {
250 if (strcmp(ptr, dev_skip[i]) == 0) {
251 found = 1;
252 break;
253 }
254 i++;
255 }
256 if (!found)
257 filedb_add(dev_out, ptr);
258}
259
260void build_dev(const char *fname) {
261 assert(fname);
262
263 process_files(fname, "/tmp", tmp_callback);
264
265 if (dev_out == NULL)
266 printf("private-dev\n");
267 else {
268 printf("\n");
269 printf("# private-dev\n");
270 printf("# This is the list of devices accessed (on top of regular private-dev devices:\n");
271 printf("# ");
272 FileDB *ptr = dev_out;
273 while (ptr) {
274 printf("%s,", ptr->fname);
275 ptr = ptr->next;
276 }
277 printf("\n");
278 }
279}
280
diff --git a/src/fbuilder/build_home.c b/src/fbuilder/build_home.c
new file mode 100644
index 000000000..947f172d8
--- /dev/null
+++ b/src/fbuilder/build_home.c
@@ -0,0 +1,199 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#include "fbuilder.h"
22
23static FileDB *db_skip = NULL;
24static FileDB *db_out = NULL;
25
26static void load_whitelist_common(void) {
27 FILE *fp = fopen("/etc/firejail/whitelist-common.inc", "r");
28 if (!fp) {
29 fprintf(stderr, "Error: cannot open whitelist-common.inc\n");
30 exit(1);
31 }
32
33 char buf[MAX_BUF];
34 while (fgets(buf, MAX_BUF, fp)) {
35 if (strncmp(buf, "whitelist ~/", 12) != 0)
36 continue;
37 char *fn = buf + 12;
38 char *ptr = strchr(buf, '\n');
39 if (!ptr)
40 continue;
41 *ptr = '\0';
42
43 // add the file to skip list
44 db_skip = filedb_add(db_skip, fn);
45 }
46
47 fclose(fp);
48}
49
50void process_home(const char *fname, char *home, int home_len) {
51 assert(fname);
52 assert(home);
53 assert(home_len);
54
55 // process trace file
56 FILE *fp = fopen(fname, "r");
57 if (!fp) {
58 fprintf(stderr, "Error: cannot open %s\n", fname);
59 exit(1);
60 }
61
62 char buf[MAX_BUF];
63 while (fgets(buf, MAX_BUF, fp)) {
64 // remove \n
65 char *ptr = strchr(buf, '\n');
66 if (ptr)
67 *ptr = '\0';
68
69 // parse line: 4:galculator:access /etc/fonts/conf.d:0
70 // number followed by :
71 ptr = buf;
72 if (!isdigit(*ptr))
73 continue;
74 while (isdigit(*ptr))
75 ptr++;
76 if (*ptr != ':')
77 continue;
78 ptr++;
79
80 // next :
81 ptr = strchr(ptr, ':');
82 if (!ptr)
83 continue;
84 ptr++;
85 if (strncmp(ptr, "access /home", 12) == 0)
86 ptr += 7;
87 else if (strncmp(ptr, "fopen /home", 11) == 0)
88 ptr += 6;
89 else if (strncmp(ptr, "fopen64 /home", 13) == 0)
90 ptr += 8;
91 else if (strncmp(ptr, "open64 /home", 12) == 0)
92 ptr += 7;
93 else if (strncmp(ptr, "open /home", 10) == 0)
94 ptr += 5;
95 else
96 continue;
97
98 // end of filename
99 char *ptr2 = strchr(ptr, ':');
100 if (!ptr2)
101 continue;
102 *ptr2 = '\0';
103
104 // check home directory
105 if (strncmp(ptr, home, home_len) != 0)
106 continue;
107 if (strcmp(ptr, home) == 0)
108 continue;
109 ptr += home_len + 1;
110
111 // skip files handled automatically by firejail
112 if (strcmp(ptr, ".Xauthority") == 0 ||
113 strcmp(ptr, ".Xdefaults-debian") == 0 ||
114 strncmp(ptr, ".config/pulse/", 13) == 0 ||
115 strncmp(ptr, ".pulse/", 7) == 0 ||
116 strncmp(ptr, ".bash_hist", 10) == 0 ||
117 strcmp(ptr, ".bashrc") == 0)
118 continue;
119
120
121 // try to find the relevant directory for this file
122 char *dir = extract_dir(ptr);
123 char *toadd = (dir)? dir: ptr;
124
125 // skip some dot directories
126 if (strcmp(toadd, ".config") == 0 ||
127 strcmp(toadd, ".local") == 0 ||
128 strcmp(toadd, ".local/share") == 0 ||
129 strcmp(toadd, ".cache") == 0) {
130 if (dir)
131 free(dir);
132 continue;
133 }
134
135 // clean .cache entries
136 if (strncmp(toadd, ".cache/", 7) == 0) {
137 char *ptr2 = toadd + 7;
138 ptr2 = strchr(ptr2, '/');
139 if (ptr2)
140 *ptr2 = '\0';
141 }
142
143 // skip files and directories in whitelist-common.inc
144 if (filedb_find(db_skip, toadd)) {
145 if (dir)
146 free(dir);
147 continue;
148 }
149
150 // add the file to out list
151 db_out = filedb_add(db_out, toadd);
152 if (dir)
153 free(dir);
154
155 }
156 fclose(fp);
157}
158
159
160// process fname, fname.1, fname.2, fname.3, fname.4, fname.5
161void build_home(const char *fname) {
162 assert(fname);
163
164 // load whitelist common
165 load_whitelist_common();
166
167 // find user home directory
168 struct passwd *pw = getpwuid(getuid());
169 if (!pw)
170 errExit("getpwuid");
171 char *home = pw->pw_dir;
172 if (!home)
173 errExit("getpwuid");
174 int home_len = strlen(home);
175
176 // run fname
177 process_home(fname, home, home_len);
178
179 // run all the rest
180 struct stat s;
181 int i;
182 for (i = 1; i <= 5; i++) {
183 char *newname;
184 if (asprintf(&newname, "%s.%d", fname, i) == -1)
185 errExit("asprintf");
186 if (stat(newname, &s) == 0)
187 process_home(newname, home, home_len);
188 free(newname);
189 }
190
191 // print the out list if any
192 if (db_out) {
193 filedb_print(db_out, "whitelist ~/");
194 printf("include /etc/firejail/whitelist-common.inc\n");
195 }
196 else
197 printf("private\n");
198
199} \ No newline at end of file
diff --git a/src/fbuilder/build_profile.c b/src/fbuilder/build_profile.c
new file mode 100644
index 000000000..3f5fe48ca
--- /dev/null
+++ b/src/fbuilder/build_profile.c
@@ -0,0 +1,165 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#include "fbuilder.h"
22#include <sys/wait.h>
23#include <fcntl.h>
24
25#define TRACE_OUTPUT "/tmp/firejail-trace"
26#define STRACE_OUTPUT "/tmp/firejail-strace"
27
28static char *cmdlist[] = {
29 "/usr/bin/firejail",
30 "--quiet",
31 "--output=" TRACE_OUTPUT,
32 "--noprofile",
33 "--caps.drop=all",
34 "--nonewprivs",
35 "--trace",
36 "--shell=none",
37 "/usr/bin/strace", // also used as a marker in build_profile()
38 "-c",
39 "-f",
40 "-o" STRACE_OUTPUT,
41};
42
43static void clear_tmp_files(void) {
44 unlink(STRACE_OUTPUT);
45 unlink(TRACE_OUTPUT);
46
47 // run all the rest
48 int i;
49 for (i = 1; i <= 5; i++) {
50 char *newname;
51 if (asprintf(&newname, "%s.%d", TRACE_OUTPUT, i) == -1)
52 errExit("asprintf");
53 unlink(newname);
54 free(newname);
55 }
56
57}
58
59void build_profile(int argc, char **argv, int index) {
60 // next index is the application name
61 if (index >= argc) {
62 fprintf(stderr, "Error: application name missing\n");
63 exit(1);
64 }
65
66 // clean /tmp files
67 clear_tmp_files();
68
69 // detect strace
70 int have_strace = 0;
71 if (access("/usr/bin/strace", X_OK) == 0)
72 have_strace = 1;
73
74 // calculate command length
75 int len = (int) sizeof(cmdlist) / sizeof(char*) + argc - index + 1;
76 if (arg_debug)
77 printf("command len %d + %d + 1\n", (int) (sizeof(cmdlist) / sizeof(char*)), argc - index);
78 char *cmd[len];
79
80 // build command
81 int i = 0;
82 for (i = 0; i < (int) sizeof(cmdlist) / sizeof(char*); i++) {
83 // skip strace if not installed
84 if (have_strace == 0 && strcmp(cmdlist[i], "/usr/bin/strace") == 0)
85 break;
86 cmd[i] = cmdlist[i];
87 }
88
89 int i2 = index;
90 for (; i < (len - 1); i++, i2++)
91 cmd[i] = argv[i2];
92 cmd[i] = NULL;
93
94 if (arg_debug) {
95 for (i = 0; i < len; i++)
96 printf("\t%s\n", cmd[i]);
97 }
98
99 // fork and execute
100 pid_t child = fork();
101 if (child == -1)
102 errExit("fork");
103 if (child == 0) {
104 int rv = execvp(cmd[0], cmd);
105 errExit("execv");
106 }
107
108 // wait for all processes to finish
109 int status;
110 if (waitpid(child, &status, 0) != child)
111 errExit("waitpid");
112
113 if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
114 printf("\n\n\n");
115 printf("############################################\n");
116 printf("# %s profile\n", argv[index]);
117 printf("############################################\n");
118 printf("# Persistent global definitions\n");
119 printf("# include /etc/firejail/globals.local\n");
120 printf("\n");
121
122 printf("### basic blacklisting\n");
123 printf("include /etc/firejail/disable-common.inc\n");
124 printf("# include /etc/firejail/disable-devel.inc\n");
125 printf("include /etc/firejail/disable-passwdmgr.inc\n");
126 printf("# include /etc/firejail/disable-programs.inc\n");
127 printf("\n");
128
129 printf("### home directory whitelisting\n");
130 build_home(TRACE_OUTPUT);
131 printf("\n");
132
133 printf("### filesystem\n");
134 build_tmp(TRACE_OUTPUT);
135 build_dev(TRACE_OUTPUT);
136 build_etc(TRACE_OUTPUT);
137 build_var(TRACE_OUTPUT);
138 build_bin(TRACE_OUTPUT);
139 printf("\n");
140
141 printf("### security filters\n");
142 printf("caps.drop all\n");
143 printf("nonewprivs\n");
144 printf("seccomp\n");
145 if (have_strace)
146 build_seccomp(STRACE_OUTPUT);
147 else {
148 printf("# If you install strace on your system, Firejail will also create a\n");
149 printf("# whitelisted seccomp filter.\n");
150 }
151 printf("\n");
152
153 printf("### network\n");
154 build_protocol(TRACE_OUTPUT);
155 printf("\n");
156
157 printf("### environment\n");
158 printf("shell none\n");
159
160 }
161 else {
162 fprintf(stderr, "Error: cannot run the sandbox\n");
163 exit(1);
164 }
165}
diff --git a/src/fbuilder/build_seccomp.c b/src/fbuilder/build_seccomp.c
new file mode 100644
index 000000000..18a767518
--- /dev/null
+++ b/src/fbuilder/build_seccomp.c
@@ -0,0 +1,191 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#include "fbuilder.h"
22
23void build_seccomp(const char *fname) {
24 assert(fname);
25
26 FILE *fp = fopen(fname, "r");
27 if (!fp) {
28 fprintf(stderr, "Error: cannot open %s\n", fname);
29 exit(1);
30 }
31
32 char buf[MAX_BUF];
33 int line = 1;
34 int position = 0;
35 int cnt = 0;
36 while (fgets(buf, MAX_BUF, fp)) {
37 // remove \n
38 char *ptr = strchr(buf, '\n');
39 if (ptr)
40 *ptr = '\0';
41
42 // first line:
43 //% time seconds usecs/call calls errors syscall
44 if (line == 1) {
45 // extract syscall position
46 ptr = strstr(buf, "syscall");
47 if (*buf != '%' || ptr == NULL) {
48 // skip this line, it could be garbage from strace
49 continue;
50 }
51 position = (int) (ptr - buf);
52 }
53 else if (line == 2) {
54 if (*buf != '-') {
55 fprintf(stderr, "Error: invalid strace output\n%s\n", buf);
56 exit(1);
57 }
58 }
59 else {
60 // get out on the next "----" line
61 if (*buf == '-')
62 break;
63
64 if (line == 3)
65 printf("# seccomp.keep %s", buf + position);
66 else
67 printf(",%s", buf + position);
68 cnt++;
69 }
70 line++;
71 }
72 printf("\n");
73 printf("# %d syscalls total\n", cnt);
74 printf("# Probably you will need to add more syscalls to seccomp.keep. Look for\n");
75 printf("# seccomp errors in /var/log/syslog or /var/log/audit/audit.log while\n");
76 printf("# running your sandbox.\n");
77
78 fclose(fp);
79}
80
81//***************************************
82// protocol
83//***************************************
84int unix_s = 0;
85int inet = 0;
86int inet6 = 0;
87int netlink = 0;
88int packet = 0;
89static void process_protocol(const char *fname) {
90 assert(fname);
91
92 // process trace file
93 FILE *fp = fopen(fname, "r");
94 if (!fp) {
95 fprintf(stderr, "Error: cannot open %s\n", fname);
96 exit(1);
97 }
98
99 char buf[MAX_BUF];
100 while (fgets(buf, MAX_BUF, fp)) {
101 // remove \n
102 char *ptr = strchr(buf, '\n');
103 if (ptr)
104 *ptr = '\0';
105
106 // parse line: 4:galculator:access /etc/fonts/conf.d:0
107 // number followed by :
108 ptr = buf;
109 if (!isdigit(*ptr))
110 continue;
111 while (isdigit(*ptr))
112 ptr++;
113 if (*ptr != ':')
114 continue;
115 ptr++;
116
117 // next :
118 ptr = strchr(ptr, ':');
119 if (!ptr)
120 continue;
121 ptr++;
122 if (strncmp(ptr, "socket ", 7) == 0)
123 ptr += 7;
124 else
125 continue;
126
127 if (strncmp(ptr, "AF_LOCAL ", 9) == 0)
128 unix_s = 1;
129 else if (strncmp(ptr, "AF_INET ", 8) == 0)
130 inet = 1;
131 else if (strncmp(ptr, "AF_INET6 ", 9) == 0)
132 inet6 = 1;
133 else if (strncmp(ptr, "AF_NETLINK ", 9) == 0)
134 netlink = 1;
135 else if (strncmp(ptr, "AF_PACKET ", 9) == 0)
136 packet = 1;
137 }
138
139 fclose(fp);
140}
141
142
143// process fname, fname.1, fname.2, fname.3, fname.4, fname.5
144void build_protocol(const char *fname) {
145 assert(fname);
146
147 // run fname
148 process_protocol(fname);
149
150 // run all the rest
151 struct stat s;
152 int i;
153 for (i = 1; i <= 5; i++) {
154 char *newname;
155 if (asprintf(&newname, "%s.%d", fname, i) == -1)
156 errExit("asprintf");
157 if (stat(newname, &s) == 0)
158 process_protocol(newname);
159 free(newname);
160 }
161
162 int net = 0;
163 if (unix_s || inet || inet6 || netlink || packet) {
164 printf("protocol ");
165 if (unix_s)
166 printf("unix,");
167 if (inet) {
168 printf("inet,");
169 net = 1;
170 }
171 if (inet6) {
172 printf("inet6,");
173 net = 1;
174 }
175 if (netlink)
176 printf("netlink,");
177 if (packet) {
178 printf("packet");
179 net = 1;
180 }
181 printf("\n");
182 }
183
184 if (net == 0)
185 printf("net none\n");
186 else {
187 printf("# net eth0\n");
188 printf("netfilter\n");
189 }
190}
191
diff --git a/src/fbuilder/fbuilder.h b/src/fbuilder/fbuilder.h
new file mode 100644
index 000000000..c448f3e06
--- /dev/null
+++ b/src/fbuilder/fbuilder.h
@@ -0,0 +1,68 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#ifndef FBUILDER_H
22#define FBUILDER_H
23#include "../include/common.h"
24#include <sys/types.h>
25#include <pwd.h>
26#include <sys/types.h>
27#include <sys/stat.h>
28
29
30#define MAX_BUF 4096
31// main.c
32extern int arg_debug;
33
34// build_profile.c
35void build_profile(int argc, char **argv, int index);
36
37// build_seccomp.c
38void build_seccomp(const char *fname);
39void build_protocol(const char *fname);
40
41// build_fs.c
42void build_etc(const char *fname);
43void build_var(const char *fname);
44void build_tmp(const char *fname);
45void build_dev(const char *fname);
46
47// build_bin.c
48void build_bin(const char *fname);
49
50// build_home.c
51void build_home(const char *fname);
52
53// utils.c
54int is_dir(const char *fname);
55char *extract_dir(char *fname);
56
57// filedb.c
58typedef struct filedb_t {
59 struct filedb_t *next;
60 char *fname; // file name
61 int len; // length of file name
62} FileDB;
63
64FileDB *filedb_add(FileDB *head, const char *fname);
65FileDB *filedb_find(FileDB *head, const char *fname);
66void filedb_print(FileDB *head, const char *prefix);
67
68#endif \ No newline at end of file
diff --git a/src/fbuilder/filedb.c b/src/fbuilder/filedb.c
new file mode 100644
index 000000000..a76fbc961
--- /dev/null
+++ b/src/fbuilder/filedb.c
@@ -0,0 +1,79 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#include "fbuilder.h"
22
23FileDB *filedb_find(FileDB *head, const char *fname) {
24 FileDB *ptr = head;
25 int found = 0;
26 int len = strlen(fname);
27
28 while (ptr) {
29 // exact name
30 if (strcmp(fname, ptr->fname) == 0) {
31 found = 1;
32 break;
33 }
34
35 // parent directory in the list
36 if (len > ptr->len &&
37 fname[ptr->len] == '/' &&
38 strncmp(ptr->fname, fname, ptr->len) == 0) {
39 found = 1;
40 break;
41 }
42
43 ptr = ptr->next;
44 }
45
46 if (found)
47 return ptr;
48
49 return NULL;
50}
51
52FileDB *filedb_add(FileDB *head, const char *fname) {
53 assert(fname);
54
55 // don't add it if it is already there or if the parent directory is already in the list
56 if (filedb_find(head, fname))
57 return head;
58
59 // add a new entry
60 FileDB *entry = malloc(sizeof(FileDB));
61 if (!entry)
62 errExit("malloc");
63 memset(entry, 0, sizeof(FileDB));
64 entry->fname = strdup(fname);
65 if (!entry->fname)
66 errExit("strdup");
67 entry->len = strlen(entry->fname);
68 entry->next = head;
69 return entry;
70};
71
72void filedb_print(FileDB *head, const char *prefix) {
73 FileDB *ptr = head;
74 while (ptr) {
75 printf("%s%s\n", prefix, ptr->fname);
76 ptr = ptr->next;
77 }
78}
79
diff --git a/src/fbuilder/main.c b/src/fbuilder/main.c
new file mode 100644
index 000000000..83217ef98
--- /dev/null
+++ b/src/fbuilder/main.c
@@ -0,0 +1,71 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "fbuilder.h"
21int arg_debug = 0;
22
23static void usage(void) {
24 printf("Firejail profile builder\n");
25 printf("Usage: firejail [--debug] --build program-and-arguments\n");
26}
27
28int main(int argc, char **argv) {
29#if 0
30{
31system("cat /proc/self/status");
32int i;
33for (i = 0; i < argc; i++)
34 printf("*%s* ", argv[i]);
35printf("\n");
36}
37#endif
38
39 int i;
40 int prog_index = 0;
41
42 // parse arguments and extract program index
43 for (i = 1; i < argc; i++) {
44 if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-?") ==0) {
45 usage();
46 return 0;
47 }
48 else if (strcmp(argv[i], "--debug") == 0)
49 arg_debug = 1;
50 else if (strcmp(argv[i], "--build") == 0)
51 ; // do nothing, this is passed down from firejail
52 else {
53 if (*argv[i] == '-') {
54 fprintf(stderr, "Error fbuilder: invalid program\n");
55 usage();
56 exit(1);
57 }
58 prog_index = i;
59 break;
60 }
61 }
62
63 if (prog_index == 0) {
64 fprintf(stderr, "Error fbuilder: program and arguments required\n");
65 usage();
66 exit(1);
67 }
68
69 build_profile(argc, argv, prog_index);
70 return 0;
71}
diff --git a/src/fbuilder/utils.c b/src/fbuilder/utils.c
new file mode 100644
index 000000000..902290899
--- /dev/null
+++ b/src/fbuilder/utils.c
@@ -0,0 +1,72 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#include "fbuilder.h"
22
23// todo: duplicated from src/firejail/util.c - remove dplication
24// return 1 if the file is a directory
25int is_dir(const char *fname) {
26 assert(fname);
27 if (*fname == '\0')
28 return 0;
29
30 // if fname doesn't end in '/', add one
31 int rv;
32 struct stat s;
33 if (fname[strlen(fname) - 1] == '/')
34 rv = stat(fname, &s);
35 else {
36 char *tmp;
37 if (asprintf(&tmp, "%s/", fname) == -1) {
38 fprintf(stderr, "Error: cannot allocate memory, %s:%d\n", __FILE__, __LINE__);
39 errExit("asprintf");
40 }
41 rv = stat(tmp, &s);
42 free(tmp);
43 }
44
45 if (rv == -1)
46 return 0;
47
48 if (S_ISDIR(s.st_mode))
49 return 1;
50
51 return 0;
52}
53
54// return NULL if fname is already a directory, or if no directory found
55char *extract_dir(char *fname) {
56 assert(fname);
57 if (is_dir(fname))
58 return NULL;
59
60 char *name = strdup(fname);
61 if (!name)
62 errExit("strdup");
63
64 char *ptr = strrchr(name, '/');
65 if (!ptr) {
66 free(name);
67 return NULL;
68 }
69 *ptr = '\0';
70
71 return name;
72}
diff --git a/src/fcopy/main.c b/src/fcopy/main.c
index da5ade428..e7b4ffa8a 100644
--- a/src/fcopy/main.c
+++ b/src/fcopy/main.c
@@ -22,6 +22,7 @@
22#include <fcntl.h> 22#include <fcntl.h>
23#include <ftw.h> 23#include <ftw.h>
24#include <errno.h> 24#include <errno.h>
25#include <pwd.h>
25 26
26int arg_quiet = 0; 27int arg_quiet = 0;
27static int arg_follow_link = 0; 28static int arg_follow_link = 0;
@@ -199,10 +200,22 @@ static char *check(const char *src) {
199 if (!rsrc || stat(rsrc, &s) == -1) 200 if (!rsrc || stat(rsrc, &s) == -1)
200 goto errexit; 201 goto errexit;
201 202
202 // check uid 203 // on systems with systemd-resolved installed /etc/resolve.conf is a symlink to
204 // /run/systemd/resolve/resolv.conf; this file is owned by systemd-resolve user
203 // checking gid will fail for files with a larger group such as /usr/bin/mutt_dotlock 205 // checking gid will fail for files with a larger group such as /usr/bin/mutt_dotlock
204 if (s.st_uid != getuid()/* || s.st_gid != getgid()*/) 206 uid_t user = getuid();
205 goto errexit; 207 if (user == 0 && strcmp(rsrc, "/run/systemd/resolve/resolv.conf") == 0) {
208 // check user systemd-resolve
209 struct passwd *p = getpwnam("systemd-resolve");
210 if (!p)
211 goto errexit;
212 if (s.st_uid != user && s.st_uid != p->pw_uid)
213 goto errexit;
214 }
215 else {
216 if (s.st_uid != user)
217 goto errexit;
218 }
206 219
207 // dir, link, regular file 220 // dir, link, regular file
208 if (S_ISDIR(s.st_mode) || S_ISREG(s.st_mode) || S_ISLNK(s.st_mode)) 221 if (S_ISDIR(s.st_mode) || S_ISREG(s.st_mode) || S_ISLNK(s.st_mode))
diff --git a/src/firecfg/firecfg.config b/src/firecfg/firecfg.config
index 79b263823..95fc14d04 100644
--- a/src/firecfg/firecfg.config
+++ b/src/firecfg/firecfg.config
@@ -8,15 +8,20 @@
8Cyberfox 8Cyberfox
9FossaMail 9FossaMail
10Mathematica 10Mathematica
11Natron
11Telegram 12Telegram
13Viber
12VirtualBox 14VirtualBox
13Wire 15Wire
14Xephyr 16Xephyr
15abrowser 17abrowser
16akregator 18akregator
17amarok 19amarok
20amule
18android-studio 21android-studio
19apktool 22apktool
23ardour4
24ardour5
20arduino 25arduino
21ark 26ark
22arm 27arm
@@ -34,18 +39,33 @@ bitlbee
34bleachbit 39bleachbit
35blender 40blender
36bless 41bless
42brackets
37brasero 43brasero
38brave 44brave
39calibre 45calibre
46calligra
47calligraauthor
48calligraconverter
49calligraflow
50calligraplan
51calligraplanwork
52calligrasheets
53calligrastage
54calligrawords
40catfish 55catfish
41cherrytree 56cherrytree
42chromium 57chromium
43chromium-browser 58chromium-browser
59cin
60clamdscan
61clamdtop
62clamscan
44claws-mail 63claws-mail
45clementine 64clementine
46clipit 65clipit
47cmus 66cmus
48conkeror 67conkeror
68conky
49corebird 69corebird
50cvlc 70cvlc
51cyberfox 71cyberfox
@@ -61,6 +81,8 @@ display
61dnscrypt-proxy 81dnscrypt-proxy
62dnsmasq 82dnsmasq
63dolphin 83dolphin
84dooble
85dooble-qt4
64dosbox 86dosbox
65dragon 87dragon
66dropbox 88dropbox
@@ -85,6 +107,9 @@ flashpeak-slimjet
85flowblade 107flowblade
86fontforge 108fontforge
87franz 109franz
110freecad
111freecadcmd
112freshclam
88frozen-bubble 113frozen-bubble
89gajim 114gajim
90galculator 115galculator
@@ -118,6 +143,7 @@ google-chrome
118google-chrome-beta 143google-chrome-beta
119google-chrome-stable 144google-chrome-stable
120google-chrome-unstable 145google-chrome-unstable
146google-earth
121google-play-music-desktop-player 147google-play-music-desktop-player
122gpa 148gpa
123gpicview 149gpicview
@@ -137,6 +163,7 @@ icecat
137icedove 163icedove
138iceweasel 164iceweasel
139idea.sh 165idea.sh
166imagej
140img2txt 167img2txt
141inkscape 168inkscape
142inox 169inox
@@ -145,8 +172,10 @@ iridium-browser
145jd-gui 172jd-gui
146jitsi 173jitsi
147k3b 174k3b
175karbon
148kate 176kate
149kcalc 177kcalc
178kdenlive
150keepass 179keepass
151keepass2 180keepass2
152keepassx 181keepassx
@@ -157,12 +186,15 @@ kmail
157knotes 186knotes
158kodi 187kodi
159konversation 188konversation
189krita
160ktorrent 190ktorrent
161kwrite 191kwrite
162leafpad 192leafpad
163less 193less
164libreoffice 194libreoffice
165liferea 195liferea
196linphone
197lmms
166localc 198localc
167lodraw 199lodraw
168loffice 200loffice
@@ -176,6 +208,7 @@ luminance-hdr
176lximage-qt 208lximage-qt
177lxmusic 209lxmusic
178lynx 210lynx
211macrofusion
179mate-calc 212mate-calc
180mate-calculator 213mate-calculator
181mate-color-select 214mate-color-select
@@ -196,6 +229,7 @@ mupdf
196mupen64plus 229mupen64plus
197musescore 230musescore
198mutt 231mutt
232natron
199nautilus 233nautilus
200netsurf 234netsurf
201neverball 235neverball
@@ -234,13 +268,16 @@ rambox
234ranger 268ranger
235remmina 269remmina
236rhythmbox 270rhythmbox
271ricochet
237riot-web 272riot-web
238ristretto 273ristretto
274rocketchat
239rtorrent 275rtorrent
240scribus 276scribus
241sdat2img 277sdat2img
242seamonkey 278seamonkey
243seamonkey-bin 279seamonkey-bin
280shotcut
244silentarmy 281silentarmy
245simple-scan 282simple-scan
246simutrans 283simutrans
@@ -261,9 +298,12 @@ stellarium
261strings 298strings
262supertux2 299supertux2
263synfigstudio 300synfigstudio
301teamspeak3
264telegram 302telegram
265telegram-desktop 303telegram-desktop
304terasology
266thunderbird 305thunderbird
306tor-browser-en
267totem 307totem
268tracker 308tracker
269transmission-cli 309transmission-cli
@@ -304,6 +344,7 @@ xfce4-dict
304xfce4-notes 344xfce4-notes
305xiphos 345xiphos
306xmms 346xmms
347xmr-stak-cpu
307xonotic 348xonotic
308xonotic-glx 349xonotic-glx
309xonotic-sdl 350xonotic-sdl
@@ -314,5 +355,6 @@ xreader
314xviewer 355xviewer
315yandex-browser 356yandex-browser
316youtube-dl 357youtube-dl
358zart
317zathura 359zathura
318zoom 360zoom
diff --git a/src/firecfg/main.c b/src/firecfg/main.c
index 1ecfbf524..82b30c2c5 100644
--- a/src/firecfg/main.c
+++ b/src/firecfg/main.c
@@ -330,23 +330,39 @@ static void set_links(void) {
330 free(firejail_exec); 330 free(firejail_exec);
331} 331}
332 332
333int have_profile(const char *filename) { 333// look for a profile file in /etc/firejail diectory and in homedir/.config/firejail directory
334static int have_profile(const char *filename, const char *homedir) {
335 assert(filename);
336 assert(homedir);
337printf("test #%s# #%s#\n", filename, homedir);
338
334 // remove .desktop extension 339 // remove .desktop extension
335 char *f1 = strdup(filename); 340 char *f1 = strdup(filename);
336 if (!f1) 341 if (!f1)
337 errExit("strdup"); 342 errExit("strdup");
338 f1[strlen(filename) - 8] = '\0'; 343 f1[strlen(filename) - 8] = '\0';
344printf("#%s#\n", f1);
339 345
340 // build profile name 346 // build profile name
341 char *profname; 347 char *profname1;
342 if (asprintf(&profname, "%s/%s.profile", SYSCONFDIR, f1) == -1) 348 char *profname2;
349 if (asprintf(&profname1, "%s/%s.profile", SYSCONFDIR, f1) == -1)
343 errExit("asprintf"); 350 errExit("asprintf");
344 351 if (asprintf(&profname2, "%s/./configure/firejail/%s.profile", homedir, f1) == -1)
345 struct stat s; 352 errExit("asprintf");
346 int rv = stat(profname, &s); 353printf("#%s#\n", profname1);
354printf("#%s#\n", profname2);
355
356 int rv = 0;
357 if (access(profname1, R_OK) == 0)
358 rv = 1;
359 else if (access(profname2, R_OK) == 0)
360 rv == 1;
361
347 free(f1); 362 free(f1);
348 free(profname); 363 free(profname1);
349 return (rv == 0)? 1: 0; 364 free(profname2);
365 return rv;
350} 366}
351 367
352static void fix_desktop_files(char *homedir) { 368static void fix_desktop_files(char *homedir) {
@@ -411,7 +427,7 @@ static void fix_desktop_files(char *homedir) {
411 errExit("stat"); 427 errExit("stat");
412 428
413 // no profile in /etc/firejail, no desktop file fixing 429 // no profile in /etc/firejail, no desktop file fixing
414 if (!have_profile(filename)) 430 if (!have_profile(filename, homedir))
415 continue; 431 continue;
416 432
417 /* coverity[toctou] */ 433 /* coverity[toctou] */
diff --git a/src/firejail/main.c b/src/firejail/main.c
index 399770142..1b49c5fb3 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -849,6 +849,24 @@ static int check_arg(int argc, char **argv, const char *argument) {
849 return found; 849 return found;
850} 850}
851 851
852static void run_builder(int argc, char **argv) {
853 EUID_ASSERT();
854
855 // drop privileges
856 if (setgid(getgid()) < 0)
857 errExit("setgid/getgid");
858 if (setuid(getuid()) < 0)
859 errExit("setuid/getuid");
860 assert(getenv("LD_PRELOAD") == NULL);
861
862 argv[0] = LIBDIR "/firejail/fbuilder";
863 execvp(argv[0], argv);
864
865 perror("execvp");
866 exit(1);
867}
868
869
852//******************************************* 870//*******************************************
853// Main program 871// Main program
854//******************************************* 872//*******************************************
@@ -907,6 +925,10 @@ int main(int argc, char **argv) {
907 git_uninstall(); // this function will not return 925 git_uninstall(); // this function will not return
908#endif 926#endif
909 927
928 // profile builder
929 if (check_arg(argc, argv, "--build"))
930 run_builder(argc, argv); // this function will not return
931
910 // check argv[0] symlink wrapper if this is not a login shell 932 // check argv[0] symlink wrapper if this is not a login shell
911 if (*argv[0] != '-') 933 if (*argv[0] != '-')
912 run_symlink(argc, argv); // this function will not return 934 run_symlink(argc, argv); // this function will not return
diff --git a/src/firejail/usage.c b/src/firejail/usage.c
index fc7dbd69c..f09eb6416 100644
--- a/src/firejail/usage.c
+++ b/src/firejail/usage.c
@@ -44,6 +44,7 @@ void usage(void) {
44 printf(" --bind=filename1,filename2 - mount-bind filename1 on top of filename2.\n"); 44 printf(" --bind=filename1,filename2 - mount-bind filename1 on top of filename2.\n");
45#endif 45#endif
46 printf(" --blacklist=filename - blacklist directory or file.\n"); 46 printf(" --blacklist=filename - blacklist directory or file.\n");
47 printf(" --build - build a whitelisted profile for the application.\n");
47 printf(" -c - execute command and exit.\n"); 48 printf(" -c - execute command and exit.\n");
48 printf(" --caps - enable default Linux capabilities filter.\n"); 49 printf(" --caps - enable default Linux capabilities filter.\n");
49 printf(" --caps.drop=all - drop all capabilities.\n"); 50 printf(" --caps.drop=all - drop all capabilities.\n");
diff --git a/src/firejail/util.c b/src/firejail/util.c
index 3e0729620..4d1c94c25 100644
--- a/src/firejail/util.c
+++ b/src/firejail/util.c
@@ -196,7 +196,7 @@ static int copy_file_by_fd(int src, int dst) {
196 done += rv; 196 done += rv;
197 } 197 }
198 } 198 }
199 fflush(0); 199// fflush(0);
200 return 0; 200 return 0;
201} 201}
202 202
diff --git a/src/libtrace/libtrace.c b/src/libtrace/libtrace.c
index 5cdb254a3..04cf64997 100644
--- a/src/libtrace/libtrace.c
+++ b/src/libtrace/libtrace.c
@@ -673,3 +673,15 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
673 673
674 return rv; 674 return rv;
675} 675}
676
677// every time a new process is started, this gets called
678// it can be used to build things like private-bin
679__attribute__((constructor))
680static void log_exec(int argc, char** argv) {
681 static char buf[PATH_MAX + 1];
682 int rv = readlink("/proc/self/exe", buf, PATH_MAX);
683 if (rv != -1) {
684 buf[rv] = '\0'; // readlink does not add a '\0' at the end
685 printf("%u:%s:exec %s:0\n", pid(), name(), buf);
686 }
687}
diff --git a/src/man/firejail.txt b/src/man/firejail.txt
index 2dd3abbb7..f205bfa30 100644
--- a/src/man/firejail.txt
+++ b/src/man/firejail.txt
@@ -154,6 +154,18 @@ $ firejail "\-\-blacklist=/home/username/My Virtual Machines"
154.br 154.br
155$ firejail \-\-blacklist=/home/username/My\\ Virtual\\ Machines 155$ firejail \-\-blacklist=/home/username/My\\ Virtual\\ Machines
156.TP 156.TP
157\fB\-\-build
158The command builds a whitelisted profile. If /usr/bin/strace is installed on the system, it also
159builds a whitelisted seccomp profile. The program is run in a very relaxed sandbox,
160with only --caps.drop=all and --nonewprivs. Programs that raise user privileges are not supported
161in order to allow strace to run. Chromium and Chromium-based browsers will not work.
162.br
163
164.br
165Example:
166.br
167$ firejail --build vlc ~/Videos/test.mp4
168.TP
157\fB\-c 169\fB\-c
158Execute command and exit. 170Execute command and exit.
159.TP 171.TP