From a7f197324633f59bafb5d3a49996d4f4495cb0c2 Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Wed, 10 Apr 2024 00:01:26 +0100 Subject: [PATCH] feat(profile): add more whonix specific profile. --- apparmor.d/groups/whonix/systemcheck-canary | 32 +++++++++++++++++++++ apparmor.d/groups/whonix/timesanitycheck | 24 ++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 apparmor.d/groups/whonix/systemcheck-canary create mode 100644 apparmor.d/groups/whonix/timesanitycheck diff --git a/apparmor.d/groups/whonix/systemcheck-canary b/apparmor.d/groups/whonix/systemcheck-canary new file mode 100644 index 00000000..5a39fe86 --- /dev/null +++ b/apparmor.d/groups/whonix/systemcheck-canary @@ -0,0 +1,32 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2024 Alexandre Pujol +# SPDX-License-Identifier: GPL-2.0-only + +abi , + +include + +@{exec_path} = @{lib}/systemcheck/canary-daemon +profile systemcheck-canary @{exec_path} { + include + include + + @{exec_path} mr, + + @{bin}/sleep rix, + @{bin}/grep rix, + @{bin}/whoami rix, + @{bin}/cat rix, + @{bin}/date rix, + @{bin}/sleep rix, + + @{lib}/systemcheck/canary rix, + + #aa:stack systemd-detect-virt systemd-notify + @{bin}/systemd-detect-virt rPx -> &systemd-detect-virt, + @{bin}/systemd-notify rPx -> &systemd-notify, + + @{PROC}/cmdline r, + + include if exists +} \ No newline at end of file diff --git a/apparmor.d/groups/whonix/timesanitycheck b/apparmor.d/groups/whonix/timesanitycheck new file mode 100644 index 00000000..d17b8ab9 --- /dev/null +++ b/apparmor.d/groups/whonix/timesanitycheck @@ -0,0 +1,24 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2024 Alexandre Pujol +# SPDX-License-Identifier: GPL-2.0-only + +abi , + +include + +@{exec_path} = @{bin}/timesanitycheck +profile timesanitycheck @{exec_path} { + include + include + + @{exec_path} mr, + + @{bin}/cat rix, + @{bin}/date rix, + + /usr/share/timesanitycheck/{,**} r, + + owner /dev/tty rw, + + include if exists +} \ No newline at end of file