Hardcoded security module suggestion - stop the stacking insanity
"'[…]this whole "nested LSM" stuff as a design goal just needs to be all rolled back, and the new design target is "one LSM, enabled statically at build time, without the need for indirect calls."
Because we're now in the situation where the security hooks are actually a source of not just horrible performance issues, but also actual insecurity[…]"'
@oleksandr @kernellogger @torvalds
I think the more realistic starting point is to drop the nesting of major LSMs.
Have a simpler standard baseline security check (capability, bpf?) and then one build-time selectable major security module (SELinux, TOMOYO, YAMA, AppArmor, Smack, etc).
Then with time, a reduction of them will be the next step.
I do agree stacking more major security models on top of each other sounds fairly lunatic as a starting point. Nice from a user flexibility sales presentation. But that's about it too.
@kernellogger I was today years old, that's 20 in Linux years, to find out that besides AppArmor on all my Debian servers and SELinux on my Fedora workstation there's a heap of other LSMs that basically do the same, could be replaced by each other, but not quite.
Not my area of expertise and I might totally mistaken/misremember here, but I think that stuff started in Linux 3.4 with Yama; and IIRC SELinux already had something similar (but not quite) already.
Maybe the world would be a better place if we would not have down that path, not sure. And maybe we should have decided on one security system from the start and make that fit everyone.
But I see the need to run a SELinux container on a AppArmor system and vice versa.
I’ve understood by reading LKML and LWN that the problem that nested LSM’s is trying can be described as follows:
Given that the most of the popular LSM’s are made for the sake of SELinux being too tedious to configure I’ve sometimes wondered why they could not just convert their policy to SELinux policy, and not be kernel features in the first place 🤷
That said, LSM’s are not my area really, and could easily overlook some aspects that might make them useful as kernel features.
@torvalds @kernellogger @jarkko if tooling like ls could be allowed to break their defaults to let me see why tftpd can’t see the file I just copied from my home to /srv/ftp then sure.
(100% agree though on one to rule them all. So fed up with the current state of things in this domain)
@kernellogger @torvalds @troglobit Have been thinking about this and I’m aligning myself based on constraints that do exist.
Multiple LSMs do exist and since the major LSM’s are also used commercially there must be good reasons to pick one rather than another. Also there is probably bunch of real-world applications where container does not share the same LSM as the host.
The key problem in my opinion with stacking is that LSM is not well-defined entity enough. In order to being one it should be defined preferably in the kernel documentation what is NOT an LSM. If that had a great definition then I would support it.
It is not just about making that kind of constrain to the documentation but also refactoring some features out of the LSM cage. E.g. stacking Yama or POSIX capabilities does not have any meaning in that would make any sense to me. They really should be just plain kernel features.
If stacking involved only “actual” LSM’s then it could be actually useful feature. E.g. I could imagine applications that benefit the user base and does not turn out to be a freaking mess.
If i recall correctly there was yet another LSM in the queue. I’d consider blocking any new LSM’s up until this whole mess has been properly sorted. I still am puzzled about POSIX capabilities “LSM”, i.e. how it ended up to upstream because documentation does not provide any answer on its practical usefulness. On the contrary it gives good arguments of not keeping it inside LSM given that they are always on :-)
@jarkko as en end-user I frankly do not care who comes out on top. This is one of the features of Linux we need to be standardized and not have >1 flavor of. It's completely unusable and incomprehensible from userspace as it is right now. (Sorry for spamming) @kernellogger @torvalds
@kernellogger @torvalds @jarkko sorry, I’m not as well versed in this topic as the rest of you, evidently. Just wanted to give my 0.02€