diff --git a/apparmor.d/profiles-s-z/snap b/apparmor.d/profiles-s-z/snap index 193ece95..a1368e1b 100644 --- a/apparmor.d/profiles-s-z/snap +++ b/apparmor.d/profiles-s-z/snap @@ -6,8 +6,8 @@ abi , include -@{bin_dirs} = @{bin}/ /snap/snapd/@{int}@{bin}/ -@{lib_dirs} = @{lib}/ /snap/snapd/@{int}@{lib}/ +@{bin_dirs} = @{bin}/ /snap/snapd/@{int}@{bin} +@{lib_dirs} = @{lib}/ /snap/snapd/@{int}@{lib} @{exec_path} = @{bin_dirs}/snap profile snap @{exec_path} { @@ -23,7 +23,7 @@ profile snap @{exec_path} { unix (send, receive) type=stream peer=(label=apt), - mount options=(ro, silent) -> /tmp/snapd-auto-import-mount-[0-9]*/, + mount options=(ro, silent) -> /tmp/snapd-auto-import-mount-@{int}/, dbus (send, receive) bus=session path=/org/freedesktop/ interface=org.freedesktop.systemd1.Manager @@ -34,6 +34,9 @@ profile snap @{exec_path} { interface=org.freedesktop.systemd1.Manager member={StartTransientUnit,JobRemoved}, + dbus (send, receive) bus=system path=/org/freedesktop/systemd1 + interface=org.freedesktop.systemd1.Manager, + dbus send bus=session path=/org/freedesktop/portal/documents interface=org.freedesktop.portal.Documents member=GetMountPoint @@ -59,8 +62,9 @@ profile snap @{exec_path} { @{HOME}/snap/{,**} rw, - owner /tmp/snapd-auto-import-mount-[0-9]*/ rw, + owner /tmp/snapd-auto-import-mount-@{int}/ rw, + @{run}/user/@{uid}/bus rw, owner @{run}/user/@{uid}/.mutter-Xwaylandauth.[0-9A-Z]* r, owner @{run}/user/@{uid}/gdm/Xauthority r, owner @{run}/user/@{uid}/snapd-session-agent.socket rw, diff --git a/apparmor.d/profiles-s-z/snap-discard-ns b/apparmor.d/profiles-s-z/snap-discard-ns index 6cddd339..4547bb98 100644 --- a/apparmor.d/profiles-s-z/snap-discard-ns +++ b/apparmor.d/profiles-s-z/snap-discard-ns @@ -6,7 +6,7 @@ abi , include -@{lib_dirs} = @{lib}/ /snap/snapd/@{int}@{lib}/ +@{lib_dirs} = @{lib}/ /snap/snapd/@{int}@{lib} @{exec_path} = @{lib_dirs}/snapd/snap-discard-ns profile snap-discard-ns @{exec_path} { diff --git a/apparmor.d/profiles-s-z/snap-failure b/apparmor.d/profiles-s-z/snap-failure index 3324f784..0e002663 100644 --- a/apparmor.d/profiles-s-z/snap-failure +++ b/apparmor.d/profiles-s-z/snap-failure @@ -6,7 +6,7 @@ abi , include -@{lib_dirs} = @{lib}/ /snap/snapd/@{int}@{lib}/ +@{lib_dirs} = @{lib}/ /snap/snapd/@{int}@{lib} @{exec_path} = @{lib_dirs}/snapd/snap-failure profile snap-failure @{exec_path} { diff --git a/apparmor.d/profiles-s-z/snap-seccomp b/apparmor.d/profiles-s-z/snap-seccomp index c4583b2b..3ffed790 100644 --- a/apparmor.d/profiles-s-z/snap-seccomp +++ b/apparmor.d/profiles-s-z/snap-seccomp @@ -6,7 +6,7 @@ abi , include -@{lib_dirs} = @{lib}/ /snap/snapd/@{int}@{lib}/ +@{lib_dirs} = @{lib}/ /snap/snapd/@{int}@{lib} @{exec_path} = @{lib_dirs}/snapd/snap-seccomp profile snap-seccomp @{exec_path} { diff --git a/apparmor.d/profiles-s-z/snap-update-ns b/apparmor.d/profiles-s-z/snap-update-ns index 1954777a..92e8afdd 100644 --- a/apparmor.d/profiles-s-z/snap-update-ns +++ b/apparmor.d/profiles-s-z/snap-update-ns @@ -6,7 +6,7 @@ abi , include -@{lib_dirs} = @{lib}/ /snap/snapd/@{int}@{lib}/ +@{lib_dirs} = @{lib}/ /snap/snapd/@{int}@{lib} @{exec_path} = @{lib_dirs}/snapd/snap-update-ns profile snap-update-ns @{exec_path} { @@ -31,14 +31,21 @@ profile snap-update-ns @{exec_path} { /var/lib/snapd/mount/{,*} r, / r, - /snap/{,**} rw, /tmp/ r, - /tmp/.snap/{,**} rwk, + + owner /snap/{,**} rw, + + owner /var/ rw, + owner /var/snap/ rw, + owner /var/snap/**/ rw, + + owner /tmp/.snap/{,**} rwk, @{run}/snapd/lock/*.lock rwk, @{run}/snapd/ns/{,**} rw, @{sys}/fs/cgroup/{,**/} r, + @{sys}/fs/cgroup/system.slice/snap.*.service/cgroup.freeze rw, @{sys}/fs/cgroup/user.slice/user-@{uid}.slice/user@@{uid}.service/app.slice/snap*.service/cgroup.freeze rw, @{sys}/kernel/mm/transparent_hugepage/hpage_pmd_size r, diff --git a/apparmor.d/profiles-s-z/snapd b/apparmor.d/profiles-s-z/snapd index 1eaaee5b..30162134 100644 --- a/apparmor.d/profiles-s-z/snapd +++ b/apparmor.d/profiles-s-z/snapd @@ -6,8 +6,8 @@ abi , include -@{bin_dirs} = @{bin}/ /snap/snapd/@{int}@{bin}/ -@{lib_dirs} = @{lib}/ /snap/snapd/@{int}@{lib}/ +@{bin_dirs} = @{bin}/ /snap/snapd/@{int}@{bin} +@{lib_dirs} = @{lib}/ /snap/snapd/@{int}@{lib} @{exec_path} = @{lib_dirs}/snapd/snapd profile snapd @{exec_path} { @@ -74,6 +74,7 @@ profile snapd @{exec_path} { @{bin}/cp rix, @{bin}/gzip rix, @{bin}/journalctl rPx, + @{bin}/kmod rPx, @{bin}/mount rix, @{bin}/runuser rCx -> runuser, @{bin}/snap rPx, @@ -87,7 +88,7 @@ profile snapd @{exec_path} { @{bin}/update-desktop-database rPx, @{bin_dirs}/fc-cache-* mr, - @{bin_dirs}/snap rPx, + @{bin_dirs}/snap rPx -> snap, @{bin_dirs}/xdelta3 rix, @{lib_dirs}/@{multiarch}/** mr, @{lib_dirs}/@{multiarch}/ld-*.so rix, @@ -108,6 +109,7 @@ profile snapd @{exec_path} { /etc/mime.types r, /etc/modprobe.d/{,**/} r, /etc/modules-load.d/{,**/} r, + /etc/modules-load.d/*snap* rw, /etc/systemd/system/{,**/} r, /etc/systemd/system/snap* rw, /etc/systemd/user/{,**/} r, @@ -177,5 +179,13 @@ profile snapd @{exec_path} { /dev/loop-control rw, + profile runuser { + include + + @{bin}/runuser mr, + + include if exists + } + include if exists } \ No newline at end of file