~ubuntu-security/apparmor-easyprof-ubuntu/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Description: Can play audio (allows playing remote content via media-hub)
# Usage: common
/dev/ashmem rw,

# Don't include the audio abstraction and enforce use of pulse instead
/etc/pulse/ r,
/etc/pulse/* r,
/{run,dev}/shm/                    r,  # could allow enumerating apps
owner /{run,dev}/shm/pulse-shm*    rk,
deny /{run,dev}/shm/pulse-shm*     w,  # deny unless we have to have it
owner @{HOME}/.pulse-cookie        rk,
owner @{HOME}/.pulse/              r,
owner @{HOME}/.pulse/*             rk,
owner /{,var/}run/user/*/pulse/       r,
owner /{,var/}run/user/*/pulse/       w,   # shouldn't be needed, but rmdir fail otherwise
owner /{,var/}run/user/*/pulse/native rwk, # cli and dbus-socket should not be
                                           # used by confined apps
owner @{HOME}/.config/pulse/cookie rk,

# Force the use of pulseaudio and silence any denials for ALSA
deny /usr/share/alsa/alsa.conf r,
deny /dev/snd/ r,
deny /dev/snd/* r,

# Allow communications with media-hub
dbus (receive, send)
     bus=session
     path=/core/ubuntu/media/Service{,/**}
     peer=(label="{unconfined,/usr/bin/media-hub-server}"),

# Allow communications with thumbnailer for retrieving album art
dbus (send)
     bus=session
     interface="org.freedesktop.DBus.Introspectable"
     path="/com/canonical/Thumbnailer"
     member="Introspect"
     peer=(label=unconfined),
dbus (send)
     bus=session
     path="/com/canonical/Thumbnailer"
     member={GetAlbumArt,GetArtistArt,ClientConfig}
     peer=(label=unconfined),

# Allow communications with mediascanner2
dbus (send)
     bus=session
     path=/com/canonical/MediaScanner2
     interface=com.canonical.MediaScanner2
     peer=(label="{unconfined,/usr/bin/mediascanner-service*}"),
dbus (receive)
     bus=session
     peer=(label="{unconfined,/usr/bin/mediascanner-service*}"),

# sound files on the device
/usr/share/sounds/ r,
/usr/share/sounds/** r,
/custom/usr/share/sounds/ r,
/custom/usr/share/sounds/** r,

# Hardware-specific accesses
#include "/usr/share/apparmor/hardware/audio.d"