From 761c7abc7e3bc6af38226a74d5427a6ccbcdddc6 Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Fri, 14 Mar 2025 21:34:39 +0100 Subject: [PATCH] fix(profile): netplan profiles. --- apparmor.d/groups/network/netplan-generate | 14 ++++++++++++++ apparmor.d/groups/network/netplan.script | 12 ------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/apparmor.d/groups/network/netplan-generate b/apparmor.d/groups/network/netplan-generate index 738fbeb8f..283a79248 100644 --- a/apparmor.d/groups/network/netplan-generate +++ b/apparmor.d/groups/network/netplan-generate @@ -17,6 +17,8 @@ profile netplan-generate @{exec_path} flags=(attach_disconnected) { @{exec_path} mr, + @{bin}/systemctl rCx -> systemctl, + /etc/netplan/{,*} r, @{run}/systemd/generator/multi-user.target.wants/ w, @@ -38,10 +40,22 @@ profile netplan-generate @{exec_path} flags=(attach_disconnected) { @{sys}/devices/**/net/*/address r, + @{run}/netplan/ r, @{run}/udev/rules.d/ r, @{run}/udev/rules.d/@{int}-netplan{,-*}.rules{,.@{rand6}} rw, + profile systemctl { + include + include + + capability net_admin, + + @{att}/@{run}/systemd/private rw, + + include if exists + } + include if exists } diff --git a/apparmor.d/groups/network/netplan.script b/apparmor.d/groups/network/netplan.script index 15aae42d7..66994569d 100644 --- a/apparmor.d/groups/network/netplan.script +++ b/apparmor.d/groups/network/netplan.script @@ -15,7 +15,6 @@ profile netplan.script @{exec_path} flags=(attach_disconnected) { @{lib}/netplan/generate rPx, @{bin}/udevadm rCx -> udevadm, - @{bin}/systemctl rCx -> systemctl, /usr/share/netplan/{,**} r, @@ -35,17 +34,6 @@ profile netplan.script @{exec_path} flags=(attach_disconnected) { include if exists } - profile systemctl { - include - include - - capability net_admin, - - @{att}/@{run}/systemd/private rw, - - include if exists - } - include if exists }