summaryrefslogtreecommitdiff
path: root/data/apparmor/abstractions/lightdm
blob: 4be3d4a31464538319acca9bbfa01c968d38f3f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# vim:syntax=apparmor
# Profile for restricting lightdm guest session
# Author: Martin Pitt <martin.pitt@ubuntu.com>

# This abstraction provides the majority of the confinement for guest sessions.
# It is in its own abstraction so we can have a centralized place for
# confinement for the various lightdm sessions (guest, freerdp, uccsconfigure,
# etc). Note that this profile intentionally omits chromium-browser.

# Requires apparmor 2.9

  #include <abstractions/authentication>
  #include <abstractions/cups-client>
  #include <abstractions/dbus>
  #include <abstractions/dbus-session>
  #include <abstractions/dbus-accessibility>
  #include <abstractions/nameservice>
  #include <abstractions/wutmp>

  # bug in compiz https://launchpad.net/bugs/697678
  /etc/compizconfig/config rw,
  /etc/compizconfig/unity.ini rw,

  / r,
  /bin/ rmix,
  /bin/fusermount Px,
  /bin/** rmix,
  /cdrom/ rmix,
  /cdrom/** rmix,
  /dev/ r,
  /dev/** rmw, # audio devices etc.
  owner /dev/shm/** rmw,
  /etc/ r,
  /etc/** rmk,
  /etc/gdm/Xsession ix,
  /etc/X11/xdm/** ix, # needed for openSUSE's default session-wrapper
  /etc/X11/xinit/** ix, # needed for openSUSE's default session-wrapper
  /lib/ r,
  /lib/** rmixk,
  /lib32/ r,
  /lib32/** rmixk,
  /lib64/ r,
  /lib64/** rmixk,
  owner /{,run/}media/ r,
  owner /{,run/}media/** rmwlixk,  # we want access to USB sticks and the like
  /opt/ r,
  /opt/** rmixk,
  @{PROC}/ r,
  @{PROC}/* rm,
  @{PROC}/[0-9]*/net/ r,
  @{PROC}/[0-9]*/net/dev r,
  @{PROC}/asound rm,
  @{PROC}/asound/** rm,
  @{PROC}/ati rm,
  @{PROC}/ati/** rm,
  @{PROC}/sys/vm/overcommit_memory r,
  owner @{PROC}/** rm,
  # needed for gnome-keyring-daemon
  @{PROC}/*/status r,
  # needed for bamfdaemon and utilities such as ps and killall
  @{PROC}/*/stat r,
  /sbin/ r,
  /sbin/** rmixk,
  /sys/ r,
  /sys/** rm,
  # needed for confined trusted helpers, such as dbus-daemon
  /sys/kernel/security/apparmor/.access rw,
  /tmp/ rw,
  owner /tmp/** rwlkmix,
  /usr/ r,
  /usr/** rmixk,
  /var/ r,
  /var/** rmixk,
  /var/guest-data/** rw, # allow to store files permanently
  /var/tmp/ rw,
  owner /var/tmp/** rwlkm,
  /{,var/}run/ r,
  # necessary for writing to sockets, etc.
  /{,var/}run/** rmkix,
  /{,var/}run/mir_socket rw,
  /{,var/}run/screen/** wl,
  /{,var/}run/shm/** wl,
  /{,var/}run/uuidd/request w,
  # libpam-xdg-support/logind
  owner /{,var/}run/user/*/** rw,

  capability ipc_lock,

  # allow processes in the guest session to signal and ptrace each other
  signal peer=@{profile_name},
  ptrace peer=@{profile_name},
  # needed when logging out of the guest session
  signal (receive) peer=unconfined,

  unix peer=(label=@{profile_name}),
  unix (receive) peer=(label=unconfined),
  unix (create),
  unix (getattr, getopt, setopt, shutdown),
  unix (bind, listen, accept, receive, send) type=stream addr="@/com/ubuntu/upstart-session/**",
  unix (bind, listen) type=stream addr="@/tmp/dbus-*",
  unix (bind, listen) type=stream addr="@/tmp/.ICE-unix/[0-9]*",
  unix (bind, listen) type=stream addr="@/dbus-vfs-daemon/*",
  unix (bind, listen) type=stream addr="@guest*",
  unix (connect, receive, send) type=stream peer=(addr="@/tmp/dbus-*"),
  unix (connect, receive, send) type=stream peer=(addr="@/tmp/.X11-unix/X[0-9]*"),
  unix (connect, receive, send) type=stream peer=(addr="@/dbus-vfs-daemon/*"),
  unix (connect, receive, send) type=stream peer=(addr="@guest*"),

  # silence warnings for stuff that we really don't want to grant
  deny capability dac_override,
  deny capability dac_read_search,
  #deny /etc/** w, # re-enable once LP#697678 is fixed
  deny /usr/** w,
  deny /var/crash/ w,