From 896944d24d2f7bdbd3f5cad66abffb58d5a41375 Mon Sep 17 00:00:00 2001 From: Federico Quattrin Date: Thu, 10 Apr 2025 15:45:21 -0300 Subject: [PATCH 1/4] added free profile --- profiles/apparmor.d/free | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 profiles/apparmor.d/free diff --git a/profiles/apparmor.d/free b/profiles/apparmor.d/free new file mode 100644 index 000000000..a09e6c2f3 --- /dev/null +++ b/profiles/apparmor.d/free @@ -0,0 +1,18 @@ +#------------------------------------------------------------------ +# Copyright (C) 2024 Canonical Ltd. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of version 2 of the GNU General Public +# License published by the Free Software Foundation. +#------------------------------------------------------------------ +# vim: ft=apparmor +# + +abi , +include + +profile free /usr/bin/free { + include + + include if exists +} From a23d44e28ba07091cd8d590c7d02f580a3d2ce4d Mon Sep 17 00:00:00 2001 From: Federico Quattrin Date: Thu, 10 Apr 2025 15:46:25 -0300 Subject: [PATCH 2/4] updated free profile copyright --- profiles/apparmor.d/free | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/apparmor.d/free b/profiles/apparmor.d/free index a09e6c2f3..ab04ed4d6 100644 --- a/profiles/apparmor.d/free +++ b/profiles/apparmor.d/free @@ -1,5 +1,5 @@ #------------------------------------------------------------------ -# Copyright (C) 2024 Canonical Ltd. +# Copyright (C) 2025 Canonical Ltd. # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public From 0d992be695487c36b59896deda8b389fde69ad76 Mon Sep 17 00:00:00 2001 From: Federico Quattrin Date: Thu, 10 Apr 2025 15:54:50 -0300 Subject: [PATCH 3/4] added smoke tests for free profile --- tests/profiles/free/task.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/profiles/free/task.yaml diff --git a/tests/profiles/free/task.yaml b/tests/profiles/free/task.yaml new file mode 100644 index 000000000..61a052a1e --- /dev/null +++ b/tests/profiles/free/task.yaml @@ -0,0 +1,6 @@ +summary: smoke test for the free profile +execute: | + # free works (this is a very basic test). + free + # The profile is attached based on the program path. + "$SPREAD_PATH"/tests/bin/actual-profile-of free | MATCH 'free \(enforce\)' From 8cf0bda8d2d0c4a295c1d0e9e2a2ac363b9caf68 Mon Sep 17 00:00:00 2001 From: Federico Quattrin Date: Tue, 10 Jun 2025 09:26:02 -0300 Subject: [PATCH 4/4] added '/usr/bin/free mr' in free profile --- profiles/apparmor.d/free | 2 ++ 1 file changed, 2 insertions(+) diff --git a/profiles/apparmor.d/free b/profiles/apparmor.d/free index ab04ed4d6..19b200e40 100644 --- a/profiles/apparmor.d/free +++ b/profiles/apparmor.d/free @@ -14,5 +14,7 @@ include profile free /usr/bin/free { include + /usr/bin/free mr, + include if exists }