Skip to content

Commit

Permalink
Update profiles, tentatively introduce X11 jailing
Browse files Browse the repository at this point in the history
  • Loading branch information
chiraag-nataraj committed Jul 30, 2017
1 parent bba47d3 commit 89f9339
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Tight Firejail profiles

This is a collection of tighter firejail (https://github.com/netblue30/firejail) profiles for certain applications. These may or may not work on your computer since some of them use seccomp filters, which may depend on architecture and OS. These were designed on Debian sid/experimental x86_64.

I have tentatively started enabling X11 jailing on some of these profiles. Because `xpra` servers take so long to start up, I end up starting the xpra servers separately (at login) and assign different ones for different things. For example, `:470` is for all of the jailed terminal emulators and `:480` is for mutt (and anything it spawns). I also created a jail script that simply tells `xpra` to initialize the given display number and run the given command — it's simple but handy for `xpra` servers I only need for a given program. If you use different `xpra` display numbers or don't use X11 jailing at all, simply modify or comment the `env` command in `x-terminal-emulator.profile` and `mutt.profile`.

List of currently-supported programs:
* Ardour 5
* Akregator
Expand Down
9 changes: 7 additions & 2 deletions fetchmail.profile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
whitelist ${HOME}/scripts/fetchmail-real.sh
# whitelist ${HOME}/.fetchmailrc.gpg
# whitelist /tmp/fetchmailrc
## Location of your fetchmailrc - I decrypt it into /tmp/fetchmailrc
whitelist /tmp/fetchmailrc
whitelist ${HOME}/Mail
whitelist ${HOME}/.procmailrc.gmail
whitelist ${HOME}/.procmailrc.brown
Expand All @@ -11,8 +12,12 @@ blacklist /mnt
blacklist /opt

noroot
# private-bin fetchmail,procmail,bash,chmod
private-dev
# private-etc passwd,hosts,resolv.conf
caps.drop all
seccomp
nogroups
nosound
nosound

x11 none
1 change: 1 addition & 0 deletions gimp.profile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
whitelist ${HOME}/.gimp-2.8
whitelist ${HOME}/.gtkrc-2.0
whitelist ${HOME}/.themes
whitelist ${HOME}/.fonts

whitelist ${DOWNLOADS}
whitelist ${HOME}/Pictures
Expand Down
6 changes: 6 additions & 0 deletions jail
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

DISP="$1"
COM="$2"

xpra start $DISP --start-child="$COM" --exit-with-children=yes --attach=yes
2 changes: 2 additions & 0 deletions mutt.profile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ whitelist /tmp/user/1000/mutt1000/
noexec ${HOME}
noexec /tmp

env DISPLAY=:480

# Enhance security

private-bin sh,dash,mutt,mutt_dotlock,bash,emacsclient,emacsclient.emacs25,elinks,gpg,gpg-agent,pinentry,dig,awk
Expand Down
6 changes: 4 additions & 2 deletions x-terminal-emulator.profile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ ipc-namespace
noroot
nogroups
net none
noexec /tmp
whitelist /tmp/user/1000/
whitelist /tmp/.X11-unix/
whitelist /tmp/.X11-unix/X470
whitelist /tmp/fcitx-socket-:0

noexec /tmp
env DISPLAY=:470

0 comments on commit 89f9339

Please sign in to comment.