2023-11-22 19:42:23 +01:00
|
|
|
# apparmor.d - Full set of apparmor profiles
|
2024-02-07 00:16:21 +01:00
|
|
|
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
|
2023-11-22 19:42:23 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
|
2024-03-10 15:49:31 +01:00
|
|
|
# Profile for generic systemd unit services. Only used by tiny systemd services
|
|
|
|
# that start a shell or use context specific programs.
|
|
|
|
|
2024-02-01 19:33:19 +01:00
|
|
|
# It does not specify an attachment path because it is intended to be used only
|
|
|
|
# via "Px -> systemd-service" exec transitions from the systemd profile.
|
2023-11-22 19:42:23 +01:00
|
|
|
|
2024-10-02 15:04:08 +02:00
|
|
|
abi <abi/4.0>,
|
2023-11-22 19:42:23 +01:00
|
|
|
|
|
|
|
include <tunables/global>
|
|
|
|
|
2024-05-30 13:28:12 +02:00
|
|
|
profile systemd-service flags=(attach_disconnected) {
|
2023-11-22 19:42:23 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/consoles>
|
2024-02-15 01:16:53 +01:00
|
|
|
include <abstractions/nameservice-strict>
|
|
|
|
|
|
|
|
capability chown,
|
|
|
|
capability fsetid,
|
2023-11-22 19:42:23 +01:00
|
|
|
|
2024-02-11 13:44:40 +01:00
|
|
|
@{bin}/ldconfig rix,
|
|
|
|
@{bin}/savelog rix,
|
2023-11-22 19:42:23 +01:00
|
|
|
@{bin}/systemctl rix,
|
2024-02-15 01:16:53 +01:00
|
|
|
@{bin}/gzip rix,
|
2024-01-25 23:46:22 +01:00
|
|
|
@{coreutils_path} rix,
|
2024-02-23 21:21:22 +01:00
|
|
|
@{sh_path} rmix,
|
2024-02-11 13:44:40 +01:00
|
|
|
|
2024-03-20 01:04:39 +01:00
|
|
|
# ifup@.service
|
|
|
|
@{bin}/ifup rPx,
|
|
|
|
|
2024-02-11 13:44:40 +01:00
|
|
|
# shadow.service
|
|
|
|
@{bin}/pwck rPx,
|
|
|
|
@{bin}/grpck rPx,
|
2023-11-22 19:42:23 +01:00
|
|
|
|
2023-11-22 21:04:17 +01:00
|
|
|
@{bin}/grub-editenv rPx,
|
|
|
|
@{bin}/ibus-daemon rPx,
|
2023-11-22 19:42:23 +01:00
|
|
|
|
2024-03-10 22:17:50 +01:00
|
|
|
@{bin}/* r,
|
2023-11-22 19:42:23 +01:00
|
|
|
@{lib}/ r,
|
|
|
|
|
2024-02-01 19:33:19 +01:00
|
|
|
/var/cache/ldconfig/{,**} rw,
|
2023-11-22 19:42:23 +01:00
|
|
|
|
|
|
|
/boot/grub/grubenv rw,
|
|
|
|
/boot/grub/ w,
|
|
|
|
|
2024-01-25 23:46:22 +01:00
|
|
|
/var/log/ r,
|
|
|
|
/var/log/dmesg rw,
|
|
|
|
/var/log/dmesg.* rwl -> /var/log/dmesg,
|
|
|
|
|
2024-03-05 01:16:24 +01:00
|
|
|
# man-db.service
|
|
|
|
/usr/{,local/}share/man/{,**} r,
|
2024-03-10 22:17:50 +01:00
|
|
|
/etc/manpath.config r,
|
|
|
|
/var/cache/man/{,**} rwk,
|
2024-03-05 01:16:24 +01:00
|
|
|
|
2023-11-22 21:04:17 +01:00
|
|
|
# snapd.system-shutdown.service
|
|
|
|
@{run}/initramfs/shutdown rw,
|
|
|
|
@{run}/initramfs/ rw,
|
|
|
|
|
2024-03-05 01:16:24 +01:00
|
|
|
# cockpit.socket
|
|
|
|
@{run}/cockpit/@{rand8} rw,
|
|
|
|
@{run}/cockpit/motd w,
|
|
|
|
|
2023-11-22 19:42:23 +01:00
|
|
|
@{PROC}/cmdline r,
|
|
|
|
@{PROC}/sys/kernel/osrelease r,
|
|
|
|
|
2024-02-01 19:33:19 +01:00
|
|
|
include if exists <usr/systemd-service.d>
|
|
|
|
include if exists <local/systemd-service>
|
2024-06-16 16:25:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# vim:syntax=apparmor
|