Why do we hate SELinux?
This is not a troll post. I'm genuinely confused as to why SELinux gets so much of hate. I have to say, I feel that it's a fairly robust system. The times when I had issues with it, I created a custom policy in the relevant directory and things were fixed. Maybe a couple of modules here and there at the most. It took me about 15 minutes max to figure out what permissions were being blocked and copy the commands from. Red Hat's guide.
So yeah, why do we hate SELinux?
DigitalDilemma
in reply to marauding_gibberish142 • • •I have a saying, "If it's not DNS, then it's Selinux". It blocks stuff so frequently it's a major time sink for us.
It is overly complex and difficult to understand, especially if you're developing and deploying software that does not have correct pre-rolled policies. A regular job for me is to help developers solve this - which generally means running their service, seeing what Selinux blocks on, and then applying a fix. Repeat 2-8 times until every way Selinux is trying to access a file is explicitly allowed. And sometimes, even software that comes via official repos has buggy selinux policies that break things.
Fortunately, there are tools to help you. Install setroubleshooter amd when something doesn't work, "grep seal /var/log/messages" and if it's selinux causing the problem, you'll find instructions showing you what went wrong and how to create an exception. I absolutely consider this tool essential when using any system with selinux enabled.
Shimitar
in reply to marauding_gibberish142 • • •Its just complex.
I hate it for my Android device maintainer role much more than my Linux admin role...
On Android, its a fucking mess between vendor stuff and system stuff. But not for selinux itself, but for the mess that vendors often do.
remotelove
in reply to Shimitar • • •When a security mechanism becomes more complex to manage than what it is supposed to protect, it becomes a vulnerability itself.
If you had a minimal system that you built from the ground up yourself and wanted to only have that system function in very specific ways, SELinux would be perfect. I would go so far as to say it would be nearing perfection in some ways.
Sorry, but in the real world, ain't nobody got time for that shit. If you use auto configuration tools or pre-canned configs for SELinux on a system you are unfamiliar with, it's more likely to cause application issues, create security gaps and will likely be shut off by a Jr. admin who really has no fucking clue what he is doing anyway.
It's just easier to keep your system patched and ensure basic network security practices anyway.
It's not impossible to manage these days. In the early days it was, but most everything is automagic now. If I am not mistaken, SELinux can be enabled to 'log only' which would give you data better handled by a HIPS anyway. (Don't quote me on that.)
Shimitar
in reply to remotelove • • •remotelove
in reply to Shimitar • • •unhrpetby
in reply to marauding_gibberish142 • • •Security is much more effective and adopted when it is simple. My understanding is that SELinux is not.
This means not only will fewer people use it and more people turn it off if something doesn't work, it means more people are at risk of misconfiguring their system to allow something they didn't intend to.
This is somewhat mitigated from the fact that, from my experience, Linux Security Modules cant ever make you less secure than without it. But it still can provide a false sense of security if you misconfigure it.
Here is a good article showing what I am referring to, and providing a solid security tool: BSD pledge/unveil on Linux.
Porting OpenBSD pledge() to Linux
justine.lolredxef
in reply to marauding_gibberish142 • • •Docker container can't read a bind mount. Permission issue? No, it's SELinux, again. And I didn't even install it explicitly, it just got pulled in by another package.
And to be clear, the issue isn't SELinux really, but ~~unexpected~~ non standard behaviour which I never asked for (never explicitly installed it).
Quazatron
in reply to marauding_gibberish142 • • •marauding_gibberish142
in reply to Quazatron • • •daggermoon
in reply to marauding_gibberish142 • • •gwilikers
in reply to daggermoon • • •SELinux is an access control system for Linux. Traditionally Linux uses Dynamic Access Control (DAC) which basically means the person who creates a file can determine who can access that file. Thats pretty fine for day to day use but there are some problems with this model in terms of security. One I can think of is that it's more vulnerable to privilege escalation (a hacker getting access to a higher level account like admin through a lower level account) because it puts the onus on the user to define who can access the file. SELinux was invented by our good friends at the NSA to remedy these kinds of problems. It's an example of Mandatory Access Control. It works on top of DAC by creating policies that work to prevent things like privilage escalation. It's also a lot more comprehensive than DAC. It allows for things context based access, taking into account the broader security context of an access attempt, the user's role, etc.
I'm actually not entirely sure why some people don't like it. Understandably, some people are wary of anything the NSA let's out into the public. But as it's open source and has been integrated into a number of Linux distros like Fedora, it's unlikely they've backdoored it. If I was to hazard a guess, I'd say some people don't like it for the same reason they don't like systemd: Linux has often been an OS where user's like a big degree of control through simple traditional systems and those don't like the idea of losing some of that control to the complexity overhead involved in these new systems.
kingthrillgore
in reply to marauding_gibberish142 • • •marauding_gibberish142
in reply to kingthrillgore • • •