2 # Profile for restricting lightdm guest session
3 # Author: Martin Pitt <martin.pitt@ubuntu.com>
5 # This abstraction provides the majority of the confinement for guest sessions.
6 # It is in its own abstraction so we can have a centralized place for
7 # confinement for the various lightdm sessions (guest, freerdp, uccsconfigure,
8 # etc). Note that this profile intentionally omits chromium-browser.
10 # Requires apparmor 2.9
12 #include <abstractions/authentication>
13 #include <abstractions/cups-client>
14 #include <abstractions/dbus>
15 #include <abstractions/dbus-session>
16 #include <abstractions/dbus-accessibility>
17 #include <abstractions/nameservice>
18 #include <abstractions/wutmp>
20 # bug in compiz https://launchpad.net/bugs/697678
21 /etc/compizconfig/config rw,
22 /etc/compizconfig/unity.ini rw,
31 /dev/** rmw, # audio devices etc.
32 owner /dev/shm/** rmw,
43 owner /media/** rmwlixk, # we want access to USB sticks and the like
48 @{PROC}/[0-9]*/net/ r,
49 @{PROC}/[0-9]*/net/dev r,
54 @{PROC}/sys/vm/overcommit_memory r,
56 # needed for gnome-keyring-daemon
58 # needed for bamfdaemon and utilities such as ps and killall
64 # needed for confined trusted helpers, such as dbus-daemon
65 /sys/kernel/security/apparmor/.access rw,
67 owner /tmp/** rwlkmix,
72 /var/guest-data/** rw, # allow to store files permanently
74 owner /var/tmp/** rwlkm,
76 # necessary for writing to sockets, etc.
78 /{,var/}run/screen/** wl,
79 /{,var/}run/shm/** wl,
80 /{,var/}run/uuidd/request w,
81 # libpam-xdg-support/logind
82 owner /{,var/}run/user/*/** rw,
86 # allow processes in the guest session to signal and ptrace each other
87 signal peer=@{profile_name},
88 ptrace peer=@{profile_name},
89 # needed when logging out of the guest session
90 signal (receive) peer=unconfined,
92 unix peer=(label=@{profile_name}),
93 unix (receive) peer=(label=unconfined),
95 unix (getattr, getopt, setopt, shutdown),
96 unix (bind, listen) type=stream addr="@/com/ubuntu/upstart-session/**",
97 unix (bind, listen) type=stream addr="@/tmp/dbus-*",
98 unix (bind, listen) type=stream addr="@/tmp/.ICE-unix/[0-9]*",
99 unix (bind, listen) type=stream addr="@/dbus-vfs-daemon/*",
100 unix (bind, listen) type=stream addr="@guest*",
101 unix (connect, receive, send) type=stream peer=(addr="@/tmp/dbus-*"),
102 unix (connect, receive, send) type=stream peer=(addr="@/tmp/.X11-unix/X[0-9]*"),
103 unix (connect, receive, send) type=stream peer=(addr="@/dbus-vfs-daemon/*"),
104 unix (connect, receive, send) type=stream peer=(addr="@guest*"),
106 # silence warnings for stuff that we really don't want to grant
107 deny capability dac_override,
108 deny capability dac_read_search,
109 #deny /etc/** w, # re-enable once LP#697678 is fixed