104 lines
2.7 KiB
Text
104 lines
2.7 KiB
Text
# apparmor.d - Full set of apparmor profiles
|
|
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
abi <abi/4.0>,
|
|
|
|
include <tunables/global>
|
|
|
|
@{exec_path} = @{bin}/needrestart
|
|
profile needrestart @{exec_path} flags=(attach_disconnected) {
|
|
include <abstractions/base>
|
|
include <abstractions/consoles>
|
|
include <abstractions/nameservice-strict>
|
|
include <abstractions/perl>
|
|
include <abstractions/python>
|
|
include <abstractions/wutmp>
|
|
|
|
capability checkpoint_restore,
|
|
capability dac_read_search,
|
|
capability kill,
|
|
capability sys_ptrace,
|
|
|
|
ptrace read,
|
|
|
|
mqueue (r,getattr) type=posix /,
|
|
|
|
@{exec_path} mrix,
|
|
|
|
@{bin}/* r,
|
|
@{sh_path} rix,
|
|
@{bin}/dpkg-query rpx,
|
|
@{bin}/fail2ban-server rPx,
|
|
@{bin}/locale rix,
|
|
@{python_path} rix,
|
|
@{bin}/sed rix,
|
|
@{bin}/stty rix,
|
|
@{bin}/systemctl rCx -> systemctl,
|
|
@{bin}/systemd-detect-virt rPx,
|
|
@{bin}/udevadm rCx -> udevadm,
|
|
@{bin}/unix_chkpwd rPx,
|
|
@{bin}/whiptail rPx,
|
|
@{bin}/who rix,
|
|
@{lib}/needrestart/* rPx,
|
|
/usr/share/debconf/frontend rix,
|
|
|
|
@{att}/@{lib}/@{python_name}/** r,
|
|
|
|
/usr/share/needrestart/{,**} r,
|
|
/usr/share/unattended-upgrades/unattended-upgrade-shutdown r,
|
|
|
|
/etc/debconf.conf r,
|
|
/etc/init.d/* r,
|
|
/etc/needrestart/{,**} r,
|
|
/etc/needrestart/*.d/* rix,
|
|
/etc/shadow r,
|
|
|
|
/ r,
|
|
/boot/ r,
|
|
/boot/intel-ucode.img r,
|
|
/boot/vmlinuz* r,
|
|
|
|
owner /var/lib/juju/agents/{,**} r,
|
|
owner /var/cache/debconf/{config,passwords,templates}.dat{,-new,-old} rwk,
|
|
|
|
/tmp/@{word10}/ rw,
|
|
|
|
owner @{run}/sshd.pid r,
|
|
|
|
@{PROC}/ r,
|
|
@{PROC}/@{pids}/cgroup r,
|
|
@{PROC}/@{pids}/cmdline r,
|
|
@{PROC}/@{pids}/environ r,
|
|
@{PROC}/@{pids}/maps r,
|
|
@{PROC}/@{pids}/stat r,
|
|
owner @{PROC}/@{pid}/fd/ r,
|
|
|
|
/dev/ r,
|
|
/dev/**/ r,
|
|
|
|
profile systemctl {
|
|
include <abstractions/base>
|
|
include <abstractions/app/systemctl>
|
|
|
|
capability sys_resource,
|
|
capability net_admin,
|
|
|
|
signal send set=(cont term) peer=systemd-tty-ask-password-agent,
|
|
|
|
@{bin}/systemd-tty-ask-password-agent Px,
|
|
|
|
include if exists <local/needrestart_systemctl>
|
|
}
|
|
|
|
profile udevadm {
|
|
include <abstractions/base>
|
|
include <abstractions/app/udevadm>
|
|
|
|
include if exists <local/needrestart_udevadm>
|
|
}
|
|
|
|
include if exists <local/needrestart>
|
|
}
|
|
|
|
# vim:syntax=apparmor
|