~apparmor-dev/apparmor/master

« back to all changes in this revision

Viewing changes to profiles/apparmor.d/abstractions/ubuntu-helpers

  • Committer: Steve Beattie
  • Date: 2019-02-19 09:38:13 UTC
  • Revision ID: sbeattie@ubuntu.com-20190219093813-ud526ee6hwn8nljz
The AppArmor project has been converted to git and is now hosted on
gitlab.

To get the converted repository, please do
  git clone https://gitlab.com/apparmor/apparmor

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
9
 
#
10
 
# Usage:
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.
15
 
#
16
 
# Limitations:
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.
21
 
#
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
26
 
#     - python imports
27
 
#    It is known not to work with:
28
 
#     - perl includes
29
 
# 3. Sanitizing ruby and java
30
 
#
31
 
# Use at your own risk. This profile was developed as an interim workaround for
32
 
# LP: #851986 until AppArmor utilizes proper environment filtering.
33
 
 
34
 
profile sanitized_helper {
35
 
  #include <abstractions/base>
36
 
  #include <abstractions/X>
37
 
 
38
 
  # Allow all networking
39
 
  network inet,
40
 
  network inet6,
41
 
 
42
 
  # Allow all DBus communications
43
 
  #include <abstractions/dbus-session-strict>
44
 
  #include <abstractions/dbus-strict>
45
 
  dbus,
46
 
 
47
 
  # Allow exec of anything, but under this profile. Allow transition
48
 
  # to other profiles if they exist.
49
 
  /{usr/,}bin/* Pixr,
50
 
  /{usr/,}sbin/* Pixr,
51
 
  /usr/local/bin/* Pixr,
52
 
 
53
 
  # Allow exec of libexec applications in /usr/lib* and /usr/local/lib*
54
 
  /usr/{,local/}lib*/{,**/}* Pixr,
55
 
 
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,
59
 
 
60
 
  # Allow exec of texlive font build scripts (LP: #1010909)
61
 
  /usr/share/texlive/texmf{,-dist}/web2c/{,**/}* Pixr,
62
 
 
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
66
 
  # paths (man ld.so)).
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,
73
 
 
74
 
  # Full access
75
 
  / r,
76
 
  /** rwkl,
77
 
  /{,usr/,usr/local/}lib{,32,64}/{,**/}*.so{,.*} m,
78
 
 
79
 
  # Dangerous files
80
 
  audit deny owner /**/* m,              # compiled libraries
81
 
  audit deny owner /**/*.py* r,          # python imports
82
 
}