apparmor.d/profiles/check-support-status-hook

137 lines
3.5 KiB
Text
Raw Normal View History

# vim:syntax=apparmor
# ------------------------------------------------------------------
#
2021-01-10 16:35:07 +01:00
# Copyright (C) 2020-2021 Mikhail Morfikov
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# ------------------------------------------------------------------
2020-12-10 22:33:39 +01:00
abi <abi/3.0>,
2020-12-10 22:33:39 +01:00
include <tunables/global>
@{exec_path} = /usr/share/debian-security-support/check-support-status.hook
2020-12-24 13:55:12 +01:00
profile check-support-status-hook @{exec_path} {
2020-12-10 22:33:39 +01:00
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/nameservice-strict>
@{exec_path} r,
2020-12-09 10:30:52 +01:00
/{usr/,}bin/{,ba,da}sh rix,
2020-12-09 10:30:52 +01:00
/{usr/,}bin/ r,
/{usr/,}bin/getent rix,
/{usr/,}bin/mkdir rix,
/{usr/,}bin/chown rix,
/{usr/,}bin/stat rix,
/{usr/,}bin/mktemp rix,
/{usr/,}bin/rm rix,
/{usr/,}sbin/adduser rPx,
/{usr/,}bin/check-support-status rPx,
/{usr/,}bin/debconf-escape rCx -> debconf-escape,
/{usr/,}sbin/runuser rCx -> runuser,
# Think what to do about this (#FIXME#)
/usr/share/debconf/frontend rPx,
#/usr/share/debconf/frontend rCx -> frontend,
/usr/share/debconf/confmodule r,
2020-12-09 10:30:52 +01:00
# For shell pwd
/ r,
/root/ r,
/tmp/ r,
owner /tmp/debian-security-support.postinst.*/ rw,
owner /tmp/debian-security-support.postinst.*/output rw,
2020-12-09 10:30:52 +01:00
/var/lib/ r,
/var/lib/debian-security-support/ r,
2020-12-24 13:55:12 +01:00
profile debconf-escape {
2020-12-10 22:33:39 +01:00
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/perl>
/{usr/,}bin/debconf-escape r,
/{usr/,}bin/perl r,
2020-12-09 10:30:52 +01:00
/tmp/ r,
owner /tmp/debian-security-support.postinst.*/output r,
}
2020-12-24 13:55:12 +01:00
profile frontend {
2020-12-10 22:33:39 +01:00
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/perl>
include <abstractions/nameservice-strict>
/usr/share/debconf/frontend r,
/{usr/,}bin/perl r,
2020-12-09 10:30:52 +01:00
/usr/share/debian-security-support/ r,
/usr/share/debian-security-support/check-support-status.hook rPx,
2020-12-09 10:30:52 +01:00
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/stty rix,
/{usr/,}bin/locale rix,
/etc/debconf.conf r,
owner /var/cache/debconf/{config,passwords,templates}.dat{,-new,-old} rwk,
# The following is needed when debconf uses GUI frontends.
2020-12-10 22:33:39 +01:00
include <abstractions/gtk>
include <abstractions/fonts>
include <abstractions/fontconfig-cache-read>
include <abstractions/freedesktop.org>
capability dac_read_search,
/{usr/,}bin/lsb_release rPx -> child-lsb_release,
2021-03-21 17:04:10 +01:00
/{usr/,}bin/hostname rix,
owner @{PROC}/@{pid}/mounts r,
@{HOME}/.Xauthority r,
}
2020-12-24 13:55:12 +01:00
profile runuser {
2020-12-10 22:33:39 +01:00
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/nameservice-strict>
include <abstractions/authentication>
network netlink raw,
# To remove the following errors:
# runuser: cannot set user id: Operation not permitted
capability setuid,
# To remove the following errrors:
# runuser: cannot set groups: Operation not permitted
capability setgid,
# To write records to the kernel auditing log.
capability audit_write,
/{usr/,}sbin/runuser mr,
2020-12-09 10:30:52 +01:00
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/check-support-status rPx,
owner @{PROC}/@{pids}/loginuid r,
@{PROC}/1/limits r,
/etc/security/limits.d/ r,
2020-12-09 10:30:52 +01:00
/tmp/ r,
owner /tmp/debian-security-support.postinst.*/output w,
}
2020-12-10 22:33:39 +01:00
include if exists <local/check-support-status-hook>
}