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
52 @{PROC}/sys/vm/overcommit_memory r,
54 # needed for gnome-keyring-daemon
56 # needed for bamfdaemon and utilities such as ps and killall
62 # needed for confined trusted helpers, such as dbus-daemon
63 /sys/kernel/security/apparmor/.access rw,
65 owner /tmp/** rwlkmix,
70 /var/guest-data/** rw, # allow to store files permanently
72 owner /var/tmp/** rwlkm,
74 # necessary for writing to sockets, etc.
76 /{,var/}run/shm/** wl,
77 /{,var/}run/uuidd/request w,
78 # libpam-xdg-support/logind
79 owner /{,var/}run/user/*/** rw,
83 # allow processes in the guest session to signal and ptrace each other
84 signal peer=@{profile_name},
85 ptrace peer=@{profile_name},
86 # needed when logging out of the guest session
87 signal (receive) peer=unconfined,
89 unix peer=(label=@{profile_name}),
90 unix (receive) peer=(label=unconfined),
92 unix (getattr, getopt, setopt, shutdown),
93 unix (bind, listen) type=stream addr="@/com/ubuntu/upstart-session/**",
94 unix (bind, listen) type=stream addr="@/tmp/dbus-*",
95 unix (bind, listen) type=stream addr="@/tmp/.ICE-unix/[0-9]*",
96 unix (bind, listen) type=stream addr="@/dbus-vfs-daemon/*",
97 unix (bind, listen) type=stream addr="@guest*",
98 unix (connect, receive, send) type=stream peer=(addr="@/tmp/dbus-*"),
99 unix (connect, receive, send) type=stream peer=(addr="@/tmp/.X11-unix/X[0-9]*"),
100 unix (connect, receive, send) type=stream peer=(addr="@/dbus-vfs-daemon/*"),
101 unix (connect, receive, send) type=stream peer=(addr="@guest*"),
103 # silence warnings for stuff that we really don't want to grant
104 deny capability dac_override,
105 deny capability dac_read_search,
106 #deny /etc/** w, # re-enable once LP#697678 is fixed