apparmor.d/apparmor.d/groups/apt/apt-methods-file
2025-05-26 00:47:47 +02:00

59 lines
1.5 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/file
profile apt-methods-file @{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=@{p_packagekitd},
signal receive peer=synaptic,
@{exec_path} mr,
@{lib}/apt/apt-helper rix,
/etc/apt/apt-mirrors.txt r,
/etc/apt/apt.conf r,
/etc/apt/apt.conf.d/{,*} r,
/etc/apt/mirrors/* r,
/usr/share/dpkg/cputable r,
/usr/share/dpkg/tupletable r,
# For shell pwd
/ r,
/etc/ r,
/root/ r,
/var/lib/apt/lists/{,**} rw,
owner /var/lib/apt/lists/partial/* rw,
/var/log/cron-apt/temp w,
# For package building
@{user_build_dirs}/** rwkl -> @{user_build_dirs}/**,
owner /dev/tty@{int} rw,
include if exists <local/apt-methods-file>
}
# vim:syntax=apparmor