aboutsummaryrefslogtreecommitdiff
path: root/straper/db/public/apparmor/apparmor.d/lsb_release
blob: 3f409180428d22839aeea9426172a04c3f4020c9 (plain) (blame)
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
# Note: This profile does not specify an attachment path because it is
# intended to be used only via "Px -> lsb_release" exec transitions from
# other profiles. We want to confine the lsb_release(1) utility when it
# is invoked from other confined applications, but not when it is used
# in regular (unconfined) shell scripts or run directly by the user.

abi <abi/4.0>,

include <tunables/global>

# Do not attach to /usr/bin/lsb_release by default
profile lsb_release {
  include <abstractions/base>
  include <abstractions/python>
  include <abstractions/terminfo>

  owner @{PROC}/@{pid}/fd/ r,

  /dev/tty rw,

  /usr/bin/lsb_release r,
  /usr/bin/python3.{1,}[0-9] mr,

  /etc/debian_version r,
  /etc/default/apport r,
  /etc/dpkg/origins/** r,
  /etc/lsb-release r,
  /etc/lsb-release.d/ r,

  /{usr/,}bin/bash ixr,
  /{usr/,}bin/dash ixr,
  /usr/bin/basename ixr,
  /usr/bin/dpkg-query ixr,
  /usr/bin/cat ixr,
  /usr/bin/cut ixr,
  /usr/bin/getopt ixr,
  /usr/bin/sed ixr,
  /usr/bin/tr ixr,

  # TODO - many more permissions needed for this to work
  deny /usr/bin/apt-cache x,

  /usr/bin/ r,
  /usr/include/python*/pyconfig.h r,
  /usr/share/distro-info/** r,
  /usr/share/dpkg/** r,
  /var/lib/dpkg/** r,

  # file_inherit
  deny /tmp/gtalkplugin.log w,

  # Site-specific additions and overrides. See local/README for details.
  include if exists <local/lsb_release>
}