]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - data/apparmor/abstractions/lightdm
Match seat configuration using globbing
[sojka/lightdm.git] / data / apparmor / abstractions / lightdm
1 # vim:syntax=apparmor
2 # Profile for restricting lightdm guest session
3 # Author: Martin Pitt <martin.pitt@ubuntu.com>
4
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.
9
10 # Requires apparmor 2.9
11
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>
19
20   # bug in compiz https://launchpad.net/bugs/697678
21   /etc/compizconfig/config rw,
22   /etc/compizconfig/unity.ini rw,
23
24   / r,
25   /bin/ rmix,
26   /bin/fusermount Px,
27   /bin/** rmix,
28   /cdrom/ rmix,
29   /cdrom/** rmix,
30   /dev/ r,
31   /dev/** rmw, # audio devices etc.
32   owner /dev/shm/** rmw,
33   /etc/ r,
34   /etc/** rmk,
35   /etc/gdm/Xsession ix,
36   /lib/ r,
37   /lib/** rmixk,
38   /lib32/ r,
39   /lib32/** rmixk,
40   /lib64/ r,
41   /lib64/** rmixk,
42   owner /media/ r,
43   owner /media/** rmwlixk,  # we want access to USB sticks and the like
44   /opt/ r,
45   /opt/** rmixk,
46   @{PROC}/ r,
47   @{PROC}/* rm,
48   @{PROC}/asound rm,
49   @{PROC}/asound/** rm,
50   @{PROC}/ati rm,
51   @{PROC}/ati/** rm,
52   @{PROC}/sys/vm/overcommit_memory r,
53   owner @{PROC}/** rm,
54   # needed for gnome-keyring-daemon
55   @{PROC}/*/status r,
56   # needed for bamfdaemon and utilities such as ps and killall
57   @{PROC}/*/stat r,
58   /sbin/ r,
59   /sbin/** rmixk,
60   /sys/ r,
61   /sys/** rm,
62   # needed for confined trusted helpers, such as dbus-daemon
63   /sys/kernel/security/apparmor/.access rw,
64   /tmp/ rw,
65   owner /tmp/** rwlkmix,
66   /usr/ r,
67   /usr/** rmixk,
68   /var/ r,
69   /var/** rmixk,
70   /var/guest-data/** rw, # allow to store files permanently
71   /var/tmp/ rw,
72   owner /var/tmp/** rwlkm,
73   /{,var/}run/ r,
74   # necessary for writing to sockets, etc.
75   /{,var/}run/** rmkix,
76   /{,var/}run/shm/** wl,
77   /{,var/}run/uuidd/request w,
78   # libpam-xdg-support/logind
79   owner /{,var/}run/user/*/** rw,
80
81   capability ipc_lock,
82
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,
88
89   unix peer=(label=@{profile_name}),
90   unix (receive) peer=(label=unconfined),
91   unix (create),
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*"),
102
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
107   deny /usr/** w,
108   deny /var/crash/ w,