apparmor.d/apparmor.d/groups/apt/dpkg-script-systemd

77 lines
1.9 KiB
Text

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2025 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/4.0>,
include <tunables/global>
@{exec_path} = /var/lib/dpkg/info/systemd*
profile dpkg-script-systemd @{exec_path} {
include <abstractions/base>
include <abstractions/common/debconf>
capability dac_read_search,
@{exec_path} mrix,
@{coreutils_path} rix,
@{bin}/bootctl Px,
@{bin}/deb-systemd-helper Px,
@{bin}/deb-systemd-invoke Px,
@{bin}/dpkg Cx -> dpkg,
@{bin}/dpkg-divert Px,
@{bin}/dpkg-maintscript-helper Px,
@{bin}/journalctl Px,
@{bin}/kernel-install mrPx,
@{bin}/systemctl Cx -> systemctl,
@{bin}/systemd-machine-id-setup Px,
@{bin}/systemd-sysusers Px,
@{bin}/systemd-tmpfiles Px,
@{lib}/systemd/systemd-sysctl Px,
@{sbin}/pam-auth-update Px,
/etc/systemd/system/*.wants/ rw,
/etc/systemd/system/*.wants/* rw,
/etc/pam.d/sed@{rand6} rw,
/etc/pam.d/common-password rw,
@{efi}/ r,
/var/lib/systemd/{,*} rw,
/var/log/journal/ rw,
profile dpkg {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/common/apt>
capability dac_read_search,
@{bin}/dpkg mr,
/etc/dpkg/dpkg.cfg r,
/etc/dpkg/dpkg.cfg.d/{,*} r,
include if exists <local/dpkg-script-systemd_dpkg>
}
profile systemctl {
include <abstractions/base>
include <abstractions/app/systemctl>
capability net_admin,
capability sys_resource,
signal send set=(cont term) peer=systemd-tty-ask-password-agent,
@{bin}/systemd-tty-ask-password-agent Px,
include if exists <local/dpkg-script-systemd_systemctl>
}
include if exists <local/dpkg-script-systemd>
}
# vim:syntax=apparmor