Local root vulnerability in snap-confine
Local root vulnerability in snap-confine
Posted Feb 20, 2022 13:11 UTC (Sun) by smcv (subscriber, #53363)In reply to: Local root vulnerability in snap-confine by smcv
Parent article: Local root vulnerability in snap-confine
As with the different scopes I described in my previous comment, this is a trade-off, and neither is trivially better than the other.
The fact that Snap uses AppArmor means it can rely on the LSM mechanism in the kernel, which is quite powerful, particularly if you are willing to patch the kernel (I believe Ubuntu's kernel patches to add SO_PEERSEC support to AppArmor still haven't gone upstream). If the kernel gives you information about a peer's LSM labels, then you can trust that information to be correct and securely obtained; and if a process is restricted by LSM policies, the kernel will forbid anything that those policies forbid, without needing to rely on other mechanisms like userns and seccomp as heavily as Flatpak does.
On the other hand, you need CAP_MAC_ADMIN (i.e. root) to manipulate AppArmor profiles, and if running on a distribution like Fedora that uses a different "big" LSM, or a distribution that doesn't compile any of the "big" LSMs into its kernel at all, then you're not going to be able to benefit from AppArmor at all.
Flatpak has gone for the approach that makes it work equally well on "most" distros, and give it an equal level of sandboxing on "most" distros even if installed as non-root. Snap has gone for the approach that is maximally powerful on e.g. Ubuntu, at the cost of working less well on non-Ubuntu and requiring root.
Posted Feb 21, 2022 23:32 UTC (Mon)
by Smon (guest, #104795)
[Link]
Local root vulnerability in snap-confine