From 85e7f58d3c799363afa055daaa53eb62d945b795 Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Tue, 26 Apr 2022 22:06:19 +0100 Subject: [PATCH] feat: add molly-guard profile. --- apparmor.d/profiles-m-r/molly-guard | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 apparmor.d/profiles-m-r/molly-guard diff --git a/apparmor.d/profiles-m-r/molly-guard b/apparmor.d/profiles-m-r/molly-guard new file mode 100644 index 00000000..24d9774c --- /dev/null +++ b/apparmor.d/profiles-m-r/molly-guard @@ -0,0 +1,37 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2022 Alexandre Pujol +# SPDX-License-Identifier: GPL-2.0-only + +abi , + +include + +@{exec_path} = /{usr/,}lib/molly-guard/molly-guard +profile molly-guard @{exec_path} { + include + include + + capability sys_ptrace, + + ptrace (read), + + @{exec_path} mr, + + /{usr/,}bin/{,ba,da}sh rix, + /{usr/,}bin/hostname rix, + /{usr/,}bin/pgrep rix, + /{usr/,}bin/run-parts rix, + /{usr/,}bin/systemctl rPx -> child-systemctl, + /{usr/,}bin/tr rix, + /{usr/,}bin/tty rix, + + /etc/molly-guard/{,**} r, + /etc/molly-guard/run.d/* rix, + + @{PROC}/ r, + @{PROC}/@{pids}/cmdline r, + @{PROC}/sys/kernel/osrelease r, + @{PROC}/uptime r, + + include if exists +} \ No newline at end of file