]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - data/apparmor/abstractions/lightdm
Set example multi-seat configuration to a valid seat name
[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}/[0-9]*/net/ r,
49   @{PROC}/[0-9]*/net/dev r,
50   @{PROC}/asound rm,
51   @{PROC}/asound/** rm,
52   @{PROC}/ati rm,
53   @{PROC}/ati/** rm,
54   @{PROC}/sys/vm/overcommit_memory r,
55   owner @{PROC}/** rm,
56   # needed for gnome-keyring-daemon
57   @{PROC}/*/status r,
58   # needed for bamfdaemon and utilities such as ps and killall
59   @{PROC}/*/stat r,
60   /sbin/ r,
61   /sbin/** rmixk,
62   /sys/ r,
63   /sys/** rm,
64   # needed for confined trusted helpers, such as dbus-daemon
65   /sys/kernel/security/apparmor/.access rw,
66   /tmp/ rw,
67   owner /tmp/** rwlkmix,
68   /usr/ r,
69   /usr/** rmixk,
70   /var/ r,
71   /var/** rmixk,
72   /var/guest-data/** rw, # allow to store files permanently
73   /var/tmp/ rw,
74   owner /var/tmp/** rwlkm,
75   /{,var/}run/ r,
76   # necessary for writing to sockets, etc.
77   /{,var/}run/** rmkix,
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,
83
84   capability ipc_lock,
85
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,
91
92   unix peer=(label=@{profile_name}),
93   unix (receive) peer=(label=unconfined),
94   unix (create),
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*"),
105
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
110   deny /usr/** w,
111   deny /var/crash/ w,