]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - data/apparmor/abstractions/lightdm_chromium-browser
Apply debian/patches/06_apparmor_chromium_updates.patch to checked in code
[sojka/lightdm.git] / data / apparmor / abstractions / lightdm_chromium-browser
1 # vim:syntax=apparmor
2 # Profile abstraction for restricting chromium in the lightdm guest session
3 # Author: Jamie Strandboge <jamie@canonical.com>
4
5 # The abstraction provides the additional accesses required to launch
6 # chromium based browsers from within an lightdm session. Because AppArmor
7 # cannot yet merge profiles and because we want to utilize the access rules
8 # provided in abstractions/lightdm, this abstraction must be separate from
9 # abstractions/lightdm.
10
11   /usr/lib/chromium-browser/chromium-browser Cx -> chromium,
12   /usr/bin/webapp-container Cx -> chromium,
13   /usr/bin/webbrowser-app Cx -> chromium,
14   /usr/bin/ubuntu-html5-app-launcher Cx -> chromium,
15   /opt/google/chrome-stable/google-chrome-stable Cx -> chromium,
16   /opt/google/chrome-beta/google-chrome-beta Cx -> chromium,
17   /opt/google/chrome-unstable/google-chrome-unstable Cx -> chromium,
18
19   # Allow ptracing processes in the chromium child profile
20   ptrace peer=/usr/lib/lightdm/lightdm-guest-session//chromium,
21
22   # Allow receiving and sending signals to processes in the chromium child profile
23   signal (receive, send) peer=/usr/lib/lightdm/lightdm-guest-session//chromium,
24
25   profile chromium {
26     # Allow all the same accesses as other applications in the guest session
27     #include <abstractions/lightdm>
28
29     # but also allow a few things because of chromium-browser's sandboxing that
30     # are not appropriate to other guest session applications.
31     owner @{PROC}/[0-9]*/oom_{,score_}adj w,
32     @{PROC}/sys/kernel/shmmax r,
33     capability sys_admin,  # for sandbox to change namespaces
34     capability sys_chroot, # fod sandbox to chroot to a safe directory
35     capability setgid,     # for sandbox to drop privileges
36     capability setuid,     # for sandbox to drop privileges
37     capability sys_ptrace, # chromium needs this to keep track of itself
38     @{PROC}/sys/kernel/yama/ptrace_scope r,
39
40     # Allow ptrace reads of processes in the lightdm-guest-session
41     ptrace (read) peer=/usr/lib/lightdm/lightdm-guest-session,
42     # Allow other guest session processes to read and trace us
43     ptrace (readby, tracedby) peer=/usr/lib/lightdm/lightdm-guest-session,
44     ptrace (readby, tracedby) peer=@{profile_name},
45
46     # Allow us to receive and send signals from processes in the
47     # lightdm-guest-session
48     signal (receive, send) set=("exists") peer=/usr/lib/lightdm/lightdm-guest-session,
49
50     @{PROC}/[0-9]*/ r,                 # sandbox wants these
51     @{PROC}/[0-9]*/fd/ r,              # sandbox wants these
52     @{PROC}/[0-9]*/task/[0-9]*/stat r, # sandbox wants these
53
54     /selinux/ r,
55
56     /usr/lib/chromium-browser/chromium-browser-sandbox ix,
57     /usr/lib/@{multiarch}/oxide-qt/chrome-sandbox ix,
58     /opt/google/chrome-*/chrome-sandbox ix,
59   }