From 2c6843f5fe8df736fc4fc59fb4129f3a5a3f32bf Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Mon, 13 Jun 2022 22:15:13 +0100 Subject: [PATCH] feat(profiles): add audit related profiles. --- apparmor.d/profiles-a-f/auditctl | 20 ++++++++++++++++++++ apparmor.d/profiles-a-f/augenrules | 25 +++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 apparmor.d/profiles-a-f/auditctl create mode 100644 apparmor.d/profiles-a-f/augenrules diff --git a/apparmor.d/profiles-a-f/auditctl b/apparmor.d/profiles-a-f/auditctl new file mode 100644 index 00000000..b1f1fec8 --- /dev/null +++ b/apparmor.d/profiles-a-f/auditctl @@ -0,0 +1,20 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2022 Alexandre Pujol +# SPDX-License-Identifier: GPL-2.0-only + +abi , + +include + +@{exec_path} = /{usr/,}bin/auditctl +profile auditctl @{exec_path} { + include + + capability audit_control, + + network netlink raw, + + @{exec_path} mr, + + include if exists +} \ No newline at end of file diff --git a/apparmor.d/profiles-a-f/augenrules b/apparmor.d/profiles-a-f/augenrules new file mode 100644 index 00000000..f7356dd0 --- /dev/null +++ b/apparmor.d/profiles-a-f/augenrules @@ -0,0 +1,25 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2022 Alexandre Pujol +# SPDX-License-Identifier: GPL-2.0-only + +abi , + +include + +@{exec_path} = /{usr/,}bin/augenrules +profile augenrules @{exec_path} { + include + include + + @{exec_path} mr, + + /{usr/,}bin/mktemp rix, + /{usr/,}bin/rm rix, + /{usr/,}bin/auditctl rPx, + + owner /tmp/aurules.* rw, + + /dev/tty rw, + + include if exists +} \ No newline at end of file