3 ms·
It doesn't replace SELinux, but it's similar. There are cases where app-controlled sandbox is easier to implement than selinux rules though. I'd summarise those
by viraptor 6y ago
It doesn't replace SELinux, but it's similar. There are cases where app-controlled sandbox is easier to implement than selinux rules though. I'd summarise those as: app jails are for things apps know about themselves, selinux/apparmor are for things you know about the environment the app runs in.
(not sure if these are possible with landlock)
Example 1: You start `tar` to unpack something to /foo/bar. Ideally you'd tell tar that whatever happens, it cannot write outside of /foo/bar. This is not possible to implement at runtime with selinux, without relabeling the filesystem.
Example 2: You start an app which will open a socket and then never open another connection again (just accept). You could do it with selinux or apparmor by changing context/hat, but you'd have to actually rely on one of them being enabled and setup with appropriate rules. Instead with things like seccomp and other app jails you can say "from now on, deny any listen/connect syscalls".