From bd1239b46a006d3cb227fc6fffcf95cf684e1ea2 Mon Sep 17 00:00:00 2001 From: valoq Date: Fri, 12 Jul 2024 20:11:32 +0100 Subject: [PATCH] add profiles for cmus and ouch (#408) * add profiles for cmus and ouch * minor corrections --- apparmor.d/profiles-a-f/cmus | 31 +++++++++++++++++++++++++++++++ apparmor.d/profiles-m-r/ouch | 26 ++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 apparmor.d/profiles-a-f/cmus create mode 100644 apparmor.d/profiles-m-r/ouch diff --git a/apparmor.d/profiles-a-f/cmus b/apparmor.d/profiles-a-f/cmus new file mode 100644 index 00000000..b667d81f --- /dev/null +++ b/apparmor.d/profiles-a-f/cmus @@ -0,0 +1,31 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2024 valoq +# SPDX-License-Identifier: GPL-2.0-only + +abi , + +include + +@{exec_path} = @{bin}/cmus +profile cmus @{exec_path} { + include + include + + @{exec_path} mr, + + /usr/share/cmus/{,**} r, + /usr/share/terminfo/{,**} r, + + /etc/machine-id r, + + owner @{user_music_dirs}/{,**} r, + + owner @{user_config_dirs}/ r, + owner @{user_config_dirs}/cmus/{,**} rw, + + owner @{run}/user/@{uid}/cmus-socket w, + + /dev/shm/ r, + + include if exists +} diff --git a/apparmor.d/profiles-m-r/ouch b/apparmor.d/profiles-m-r/ouch new file mode 100644 index 00000000..efd796d1 --- /dev/null +++ b/apparmor.d/profiles-m-r/ouch @@ -0,0 +1,26 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2024 valoq +# SPDX-License-Identifier: GPL-2.0-only + +abi , + +include + +@{exec_path} = @{bin}/ouch +profile ouch @{exec_path} { + include + include + include + + @{exec_path} mr, + + owner @{HOME}/.tmp@{rand6}/{,**} rw, + + @{sys}/fs/cgroup/user.slice/cpu.max r, + @{sys}/fs/cgroup/user.slice/user-@{uid}.slice/cpu.max r, + @{sys}/fs/cgroup/user.slice/user-@{uid}.slice/session-@{int}.scope/cpu.max r, + + owner @{PROC}/@{pid}/cgroup r, + + include if exists +}