Add unattended-upgrade profiles.

This commit is contained in:
Alexandre Pujol 2021-09-28 21:58:12 +01:00
parent c6ab1770d0
commit 162670237c
Failed to generate hash of commit
2 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,29 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}bin/unattended-upgrade
profile unattended-upgrade @{exec_path} {
include <abstractions/base>
include <abstractions/python>
@{exec_path} mr,
/{usr/,}bin/python3.[0-9]* rix,
/{usr/,}bin/uname rix,
/{usr/,}bin/dpkg rPx,
/{usr/,}bin/lsb_release rPx -> lsb_release,
/var/log/unattended-upgrades/*.log rw,
owner @{run}/unattended-upgrades.pid rw,
owner @{run}/unattended-upgrades.lock rwk,
owner @{PROC}/@{pids}/fd/ r,
include if exists <local/unattended-upgrade>
}

View file

@ -0,0 +1,26 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /usr/share/unattended-upgrades/unattended-upgrade-shutdown
profile unattended-upgrade-shutdown @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/nameservice-strict>
include <abstractions/python>
@{exec_path} mr,
/usr/share/unattended-upgrades/{,*} r,
/etc/apt/apt.conf.d/{,*} r,
owner /var/log/unattended-upgrades/*.log rw,
owner @{run}/unattended-upgrades.lock rwk,
owner @{run}/systemd/inhibit/[0-9]*.ref rw,
include if exists <local/unattended-upgrade-shutdown>
}