apparmor.d/apparmor.d/groups/apt/apt-methods-store
2025-04-13 22:46:53 +02:00

66 lines
1.8 KiB
Text

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2021 Mikhail Morfikov
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/4.0>,
include <tunables/global>
@{exec_path} = @{lib}/apt/methods/store
profile apt-methods-store @{exec_path} {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/nameservice-strict>
# The "_apt" user is created by the postinst script of the "apt" package. It's the owner of the
# dirs "/var/cache/apt/archives/partial/" and "/var/lib/apt/lists/partial/" . The "_apt" user is
# used by APT to download packages, package list, and other things using APT methods as an
# unprivileged user/group (_apt/nogroup).
capability setgid,
capability setuid,
signal (receive) peer=apt-get,
signal (receive) peer=apt,
signal (receive) peer=aptitude,
signal (receive) peer=packagekitd,
signal (receive) peer=role_*,
signal (receive) peer=synaptic,
@{exec_path} mr,
# apt-helper gets "no new privs" so "rix" it
@{lib}/apt/apt-helper rix,
/usr/share/dpkg/cputable r,
/usr/share/dpkg/tupletable r,
/usr/share/doc/*/changelog.* r,
/etc/apt/apt.conf.d/{,*} r,
/etc/apt/apt.conf r,
# For shell pwd
/ r,
/etc/ r,
/root/ r,
/var/lib/apt/lists/{,**} r,
/var/lib/ubuntu-advantage/apt-esm/{,**} r,
owner /var/lib/apt/lists/* rw,
owner /var/lib/apt/lists/partial/* rw,
owner /var/lib/ubuntu-advantage/apt-esm/{,**} rw,
# For package building
@{user_build_dirs}/** rwkl -> @{user_build_dirs}/**,
/tmp/ r,
owner @{tmp}/apt-changelog-*/*.changelog{,.*} rw,
# file_inherit
owner /dev/tty@{int} rw,
owner /var/log/cron-apt/temp w,
include if exists <local/apt-methods-store>
}
# vim:syntax=apparmor