| 1 |
# vim:syntax=apparmor |
| 2 |
# |
| 3 |
# abstraction used by evince binaries |
| 4 |
# |
| 5 |
|
| 6 |
include <abstractions/gnome> |
| 7 |
include <abstractions/p11-kit> |
| 8 |
include <abstractions/ubuntu-helpers> |
| 9 |
|
| 10 |
@{PROC}/[0-9]*/fd/ r, |
| 11 |
@{PROC}/[0-9]*/mountinfo r, |
| 12 |
owner @{PROC}/[0-9]*/auxv r, |
| 13 |
owner @{PROC}/[0-9]*/status r, |
| 14 |
|
| 15 |
# Doesn't seem to be required, but noisy. Maybe allow 'r' for 'b*' if needed. |
| 16 |
# Possibly move to an abstraction if anything else needs it. |
| 17 |
deny /run/udev/data/** r, |
| 18 |
|
| 19 |
# move out to the gnome abstraction if anyone else needs these |
| 20 |
/etc/udev/udev.conf r, |
| 21 |
/sys/devices/**/block/**/uevent r, |
| 22 |
|
| 23 |
# apport |
| 24 |
/etc/default/apport r, |
| 25 |
|
| 26 |
# XFCE |
| 27 |
/etc/xfce4/defaults.list r, |
| 28 |
|
| 29 |
# Lubuntu |
| 30 |
/etc/xdg/lubuntu/applications/defaults.list r, |
| 31 |
|
| 32 |
# evince specific |
| 33 |
/etc/ r, |
| 34 |
/etc/fstab r, |
| 35 |
/etc/texmf/ r, |
| 36 |
/etc/texmf/** r, |
| 37 |
/etc/xpdf/* r, |
| 38 |
owner @{HOME}/.config/evince/ rw, |
| 39 |
owner @{HOME}/.config/evince/** rwkl, |
| 40 |
|
| 41 |
/usr/bin/gs-esp ixr, |
| 42 |
/usr/bin/mktexpk Cx -> sanitized_helper, |
| 43 |
/usr/bin/mktextfm Cx -> sanitized_helper, |
| 44 |
/usr/bin/dvipdfm Cx -> sanitized_helper, |
| 45 |
/usr/bin/dvipdfmx Cx -> sanitized_helper, |
| 46 |
|
| 47 |
# gio-launch-desktop was replaced by a very small shell script |
| 48 |
/{usr/,}bin/{dash,bash} ixr, |
| 49 |
# With older GLib we might still be on the fallback code path |
| 50 |
# (remove this after Debian 11 and Ubuntu 20.04) |
| 51 |
/usr/lib/*/glib-2.0/gio-launch-desktop ixr, |
| 52 |
|
| 53 |
# supported archivers |
| 54 |
/{usr/,}bin/gzip ixr, |
| 55 |
/{usr/,}bin/bzip2 ixr, |
| 56 |
/usr/bin/unrar* ixr, |
| 57 |
/usr/bin/unzip ixr, |
| 58 |
/usr/bin/7zr ixr, |
| 59 |
/usr/lib/p7zip/7zr ixr, |
| 60 |
/usr/bin/7za ixr, |
| 61 |
/usr/lib/p7zip/7za ixr, |
| 62 |
/usr/bin/zipnote ixr, |
| 63 |
/{usr/,}bin/tar ixr, |
| 64 |
/usr/bin/xz ixr, |
| 65 |
|
| 66 |
# allow read access to anything in /usr/share, for plugins and input methods |
| 67 |
/usr/local/share/** r, |
| 68 |
/usr/share/** r, |
| 69 |
/usr/lib/ghostscript/** mr, |
| 70 |
/var/lib/ghostscript/** r, |
| 71 |
/var/lib/texmf/{,**} r, |
| 72 |
|
| 73 |
# from http://live.gnome.org/Evince/SupportedDocumentFormats. Allow |
| 74 |
# read for all supported file formats |
| 75 |
/**.[aA][iI] r, |
| 76 |
/**.[bB][mM][pP] r, |
| 77 |
/**.[dD][jJ][vV][uU] r, |
| 78 |
/**.[dD][vV][iI] r, |
| 79 |
/**.[gG][iI][fF] r, |
| 80 |
/**.[jJ][pP][gG] r, |
| 81 |
/**.[jJ][pP][eE][gG] r, |
| 82 |
/**.[oO][dD][pP] r, |
| 83 |
/**.[fFpP][dD][fF] r, |
| 84 |
/**.[pP][nN][mM] r, |
| 85 |
/**.[pP][nN][gG] r, |
| 86 |
/**.[pP][sS] r, |
| 87 |
/**.[eE][pP][sS] r, |
| 88 |
/**.[eE][pP][sS][fFiI23] r, |
| 89 |
/**.[tT][iI][fF] r, |
| 90 |
/**.[tT][iI][fF][fF] r, |
| 91 |
/**.[xX][pP][mM] r, |
| 92 |
/**.[gG][zZ] r, |
| 93 |
/**.[bB][zZ]2 r, |
| 94 |
/**.[cC][bB][rRzZ7] r, |
| 95 |
/**.[xX][zZ] r, |
| 96 |
|
| 97 |
# Use abstractions/private-files instead of abstractions/private-files-strict |
| 98 |
# and add the sensitive files manually to work around LP: #451422. The goal |
| 99 |
# is to disallow access to the .mozilla folder in general, but to allow |
| 100 |
# access to the Cache directory, which the browser may tell evince to open |
| 101 |
# from directly. |
| 102 |
|
| 103 |
include <abstractions/private-files> |
| 104 |
audit deny @{HOME}/.gnupg/{,**} mrwkl, |
| 105 |
audit deny @{HOME}/.ssh/{,**} mrwkl, |
| 106 |
audit deny @{HOME}/.gnome2_private/{,**} mrwkl, |
| 107 |
audit deny @{HOME}/.gnome2/ w, |
| 108 |
audit deny @{HOME}/.gnome2/keyrings/{,**} mrwkl, |
| 109 |
audit deny @{HOME}/.kde/{,share/,share/apps/} w, |
| 110 |
audit deny @{HOME}/.kde/share/apps/kwallet/{,**} mrwkl, |
| 111 |
audit deny @{HOME}/.pki/{,nssdb/} w, |
| 112 |
audit deny @{HOME}/.pki/nssdb/{,**} wl, |
| 113 |
|
| 114 |
audit deny @{HOME}/.mozilla/{,**/} w, |
| 115 |
audit deny @{HOME}/.mozilla/*/*/* mrwkl, |
| 116 |
audit deny @{HOME}/.mozilla/**/bookmarkbackups/{,**} mrwkl, |
| 117 |
audit deny @{HOME}/.mozilla/**/chrome/{,**} mrwkl, |
| 118 |
audit deny @{HOME}/.mozilla/**/extensions/{,**} mrwkl, |
| 119 |
audit deny @{HOME}/.mozilla/**/gm_scripts/{,**} mrwkl, |
| 120 |
|
| 121 |
audit deny @{HOME}/.config/ w, |
| 122 |
audit deny @{HOME}/.config/chromium/{,**} mrwkl, |
| 123 |
audit deny @{HOME}/.config/evolution/{,**} mrwkl, |
| 124 |
audit deny @{HOME}/.evolution/{,**} mrwkl, |
| 125 |
audit deny @{HOME}/.kde/{,share/,share/apps/} w, |
| 126 |
audit deny @{HOME}/.kde/share/config/{,**} mrwkl, |
| 127 |
audit deny @{HOME}/.kde/share/apps/kmail/{,**} mrwkl, |
| 128 |
audit deny @{HOME}/.{,mozilla-}thunderbird/{,**/} w, |
| 129 |
audit deny @{HOME}/.{,mozilla-}thunderbird/*/* mrwkl, |
| 130 |
audit deny @{HOME}/.{,mozilla-}thunderbird/*/[^C][^a][^c][^h][^e]*/{,**} mrwkl, |
| 131 |
|
| 132 |
# When LP: #451422 is fixed, change the above to simply be: |
| 133 |
##include <abstractions/private-files-strict> |
| 134 |
##owner @{HOME}/.mozilla/**/*Cache/* r, |
| 135 |
|
| 136 |
# Site-specific additions and overrides. See local/README for details. |
| 137 |
include <local/usr.bin.evince> |