feat(systemd): split systemd-sleep profile.

This commit is contained in:
Alexandre Pujol 2023-02-04 23:41:19 +00:00
parent ad23864094
commit ff76602843
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
6 changed files with 110 additions and 9 deletions

View File

@ -19,21 +19,17 @@ profile systemd-sleep @{exec_path} {
@{exec_path} mr,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/nvidia-sleep.sh rix,
/{usr/,}lib/systemd/system-sleep/hdparm rix,
/{usr/,}lib/systemd/system-sleep/nvidia rix,
/{usr/,}lib/systemd/system-sleep/sysstat.sleep rPUx,
/{usr/,}lib/systemd/system-sleep/unattended-upgrades rix,
/{usr/,}lib/systemd/system-sleep/hdparm rPx,
/{usr/,}lib/systemd/system-sleep/nvidia rPx,
/{usr/,}lib/systemd/system-sleep/sysstat.sleep rPx,
/{usr/,}lib/systemd/system-sleep/unattended-upgrades rPx,
/{usr/,}lib/systemd/system-sleep/grub2.sleep rPx,
/etc/systemd/sleep.conf r,
/etc/systemd/sleep.conf.d/{,*} r,
@{sys}/power/state rw,
@{PROC}/driver/nvidia/suspend w,
/dev/tty rw,
include if exists <local/systemd-sleep>
}

View File

@ -0,0 +1,24 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/systemd/system-sleep/grub2.sleep
profile systemd-sleep-nvidia @{exec_path} {
include <abstractions/base>
@{exec_path} mr,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/grep rix,
/{usr/,}bin/uname rix,
/etc/sysconfig/bootloader r,
@{PROC}/@{pid}/maps r,
include if exists <local/systemd-sleep-nvidia>
}

View File

@ -0,0 +1,16 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/systemd/system-sleep/hdparm
profile systemd-sleep-hdparm @{exec_path} {
include <abstractions/base>
@{exec_path} mr,
include if exists <local/systemd-sleep-hdparm>
}

View File

@ -0,0 +1,33 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/systemd/system-sleep/nvidia
profile systemd-sleep-nvidia @{exec_path} {
include <abstractions/base>
include <abstractions/nameservice-strict>
capability sys_admin,
capability sys_tty_config,
@{exec_path} mr,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/nvidia-sleep.sh rix,
/{usr/,}bin/chvt rix,
/{usr/,}bin/cat rix,
/{usr/,}bin/rm rix,
@{run}/nvidia-sleep/* rw,
@{PROC}/driver/nvidia/suspend w,
/dev/tty rw,
/dev/tty[0-9]* rw,
include if exists <local/systemd-sleep-nvidia>
}

View File

@ -0,0 +1,16 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/systemd/system-sleep/sysstat.sleep
profile systemd-sleep-sysstat @{exec_path} {
include <abstractions/base>
@{exec_path} mr,
include if exists <local/systemd-sleep-sysstat>
}

View File

@ -0,0 +1,16 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/systemd/system-sleep/unattended-upgrades
profile systemd-sleep-upgrades @{exec_path} {
include <abstractions/base>
@{exec_path} mr,
include if exists <local/systemd-sleep-upgrades>
}