1
# Lenient profile that is intended to be used when 'Ux' is desired but
2
# does not provide enough environment sanitizing. This effectively is an
3
# open profile that blacklists certain known dangerous files and also
4
# does not allow any capabilities. For example, it will not allow 'm' on files
5
# owned be the user invoking the program. While this provides some additional
6
# protection, please use with care as applications running under this profile
7
# are effectively running without any AppArmor protection. Use this profile
8
# only if the process absolutely must be run (effectively) unconfined.
11
# Because this abstraction defines the sanitized_helper profile, it must only
12
# be #included once. Therefore this abstraction should typically not be
13
# included in other abstractions so as to avoid parser errors regarding
14
# multiple definitions.
17
# 1. This does not work for root owned processes, because of the way we use
18
# owner matching in the sanitized helper. We could do a better job with
19
# this to support root, but it would make the policy harder to understand
20
# and going unconfined as root is not desirable any way.
22
# 2. For this sanitized_helper to work, the program running in the sanitized
23
# environment must open symlinks directly in order for AppArmor to mediate
24
# it. This is confirmed to work with:
25
# - compiled code which can load shared libraries
27
# It is known not to work with:
29
# 3. Sanitizing ruby and java
31
# Use at your own risk. This profile was developed as an interim workaround for
32
# LP: #851986 until AppArmor utilizes proper environment filtering.
34
profile sanitized_helper {
35
#include <abstractions/base>
36
#include <abstractions/X>
38
# Allow all networking
42
# Allow all DBus communications
43
#include <abstractions/dbus-session-strict>
44
#include <abstractions/dbus-strict>
47
# Allow exec of anything, but under this profile. Allow transition
48
# to other profiles if they exist.
51
/usr/local/bin/* Pixr,
53
# Allow exec of libexec applications in /usr/lib* and /usr/local/lib*
54
/usr/{,local/}lib*/{,**/}* Pixr,
56
# Allow exec of software-center scripts. We may need to allow wider
57
# permissions for /usr/share, but for now just do this. (LP: #972367)
58
/usr/share/software-center/* Pixr,
60
# Allow exec of texlive font build scripts (LP: #1010909)
61
/usr/share/texlive/texmf{,-dist}/web2c/{,**/}* Pixr,
63
# While the chromium and chrome sandboxes are setuid root, they only link
64
# in limited libraries so glibc's secure execution should be enough to not
65
# require the santized_helper (ie, LD_PRELOAD will only use standard system
67
/usr/lib/chromium-browser/chromium-browser-sandbox PUxr,
68
/usr/lib/chromium{,-browser}/chrome-sandbox PUxr,
69
/opt/google/chrome/chrome-sandbox PUxr,
70
/opt/google/chrome/google-chrome Pixr,
71
/opt/google/chrome/chrome Pixr,
72
/opt/google/chrome/lib*.so{,.*} m,
77
/{,usr/,usr/local/}lib{,32,64}/{,**/}*.so{,.*} m,
80
audit deny owner /**/* m, # compiled libraries
81
audit deny owner /**/*.py* r, # python imports