|
|
Log in / Subscribe / Register

SELinux and containers are complementary

SELinux and containers are complementary

Posted Nov 6, 2025 7:59 UTC (Thu) by Cyberax (✭ supporter ✭, #52523)
In reply to: SELinux and containers are complementary by tomf
Parent article: A security model for systemd

SELinux policy reflects the inherently wrong approach it takes to security. It starts with a simple idea that you just need to be able to compare the label lists. It can be formally analyzed (it's just set operations after all).

But then it turns out that you need to be able to label everything. And propagate the labels. And then have escape hatches from all of that. So pretty much every complex Linux installation ends up with disabled SELinux, some vendors don't even bother with it. Amazon ships their Amazon Linux with SELinux disabled by default.

AppArmor offers comparable security but much simpler policies. Yet it has never gained any traction because it's not complex enough, apparently.


to post comments

Complex means vulnerable

Posted Nov 6, 2025 18:32 UTC (Thu) by marcH (subscriber, #57642) [Link] (1 responses)

Vulnerabilities and bugs in general exist only thanks to complexity. There is a direct connection between complexity and bugs, every engineer sees that connection everyday. Bugs need complexity to escape code reviews, static analyzers and our limited brains.

That's why our entire field relies on abstractions: to divide and conquer into smaller bits that we can comprehend and reason about. Otherwise nothing would work at all.

So, the idea that you can make a complex system more secure by labeling and micro-managing everything and adding another layer of "complex security" on top is insane. At best, it's wasting a lot of time. At worst, it's also giving a false feeling of security.

It's not just SELinux. In a former life, I spend days trying to make sense of the apparently simpler NTFS permissions and adjust them for some not very particular use case. I eventually gave up. I bet most people don't have days for something like this.

Complexity in "security features" is in a generally much worse state than complexity in regular features because you cannot sell the former and you almost never get rewarded for getting it right. So it gets even less attention.

Anytime you see some complex security system, assume it's misused and misconfigured greatly.

Complex means vulnerable

Posted Nov 7, 2025 8:52 UTC (Fri) by taladar (subscriber, #68407) [Link]

Very true. In my experience almost every time a permission system or similar feature is created it is made orders of magnitude too complicated for most users anyway because of some theoretical case someone who never uses the system imagines during development or specification. Years later, 99.9% of all installations of the system only use the simplest 10% of that complexity but there are just enough complex cases in the existing production data that you can't migrate to a simpler system easily.

SELinux and containers are complementary

Posted Nov 7, 2025 9:13 UTC (Fri) by emmi3 (subscriber, #62443) [Link] (3 responses)

> So pretty much every complex Linux installation ends up with disabled SELinux, some vendors don't even bother with it.

I must object this claim. In my experience RedHat, CentOS and Fedora come with extensive and very usable SELinux policies.

None of our ~20 RH/COS servers has any of it disabled. Sure, if you deploy your own software, it takes some time to get everything right and it can at times be very frustrating to debug (especially if you forget about the 'dontaudit' thing). But in the end the docs are very good and we got every single service running and secured: Overleaf, Collabora, Dokuwiki, Openproject, NFS, Samba. SELinux is one of the main reasons why we choose RH/COS over Debian for our internet facing servers (the other being more stable Ceph support).

On the desktop I only had to fiddle once with SELinux on Fedora on our convertible laptop: After an upgrade the DE could not access the orientation/tilt sensor any more to rotate the screen as needed. This was easy to discover and fix.

But as always: YMMV. Using SELinux in unusual environments requires some work (possibly from an already overworked admin). But I still think it's worth it.

SELinux and containers are complementary

Posted Nov 7, 2025 19:37 UTC (Fri) by marcH (subscriber, #57642) [Link] (1 responses)

> In my experience RedHat, CentOS and Fedora come with extensive and very usable SELinux policies. None of our ~20 RH/COS servers has any of it disabled.

Just "usable" or actually adding security? Has some corresponding penetration testing been performed, are the reports available somewhere? Is there any other evidence that threats were blocked? Are you reviewing all policy changes for errors, malicious or not? That must be a lot of work!

> Sure, if you deploy your own software, it takes some time to get everything right and it can at times be very frustrating to debug (especially if you forget about the 'dontaudit' thing).

Which means 100 times more work for your entire Linux distribution than for just your own apps. So do you know who did that huge amount of work, who maintains it and how and how much you can trust them? Don't get me wrong: you need to trust your Linux distribution anyway. But was SELinux really the best use of their limited security time?

> But in the end the docs are very good and we got every single service running and secured

SELinux: check!

Too bad security is not just a collection of checkboxes. It requires actually looking at what's behind the checkboxes. So how did your SELinux penetration testing go? What is your change review process? What is the ratio between the SELinux security value you get (hard to measure, I know) and the effort you put there and how does that ratio compare to other security measures you take?

SELinux and containers are complementary

Posted Nov 7, 2025 21:05 UTC (Fri) by ballombe (subscriber, #9523) [Link]

Now there is a library to adapt selinux policy...
<https://arstechnica.com/gadgets/2025/11/commercial-spywar...>

SELinux and containers are complementary

Posted Nov 7, 2025 21:29 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link]

> I must object this claim. In my experience RedHat, CentOS and Fedora come with extensive and very usable SELinux policies.

For the default installation. They also don't _always_ work, and then you're stuck debugging the label hell. So people just give up and disable SELinux.

I claim that at this point SELinux doesn't provide more in practice than just using namespaces (containers) after dropping extra privileges.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds