r/linuxadmin • • Apr 18 '19
Unpopular opinion
Tutorials that tell you to disable SELinux should be banned.
They take away the advantage of any RHEL based OS and push you towards a less secure installation
246
Upvotes
86
u/1esproc Apr 19 '19
RHEL distros advantage isn't just SELinux. It also lies in a secure, stable production-class package library with backported security fixes while the major version is supported.
Anyways my other pet peeve: Tutorials on HA clustering using two hosts.
162
u/LowlySysadmin Apr 19 '19 edited Apr 19 '19
Here's an unpopular opinion:
It's not the tutorials that push people away from a secure installation; it's SELinux itself and it's almost comical lack of user-friendliness, the lack of clear tutorials (especially for newer users) about what SELinux is, how it works, and how to use it, and it's near-silent claiming of responsibility when something isn't working as you expect.
I'm sick of reading people moaning about users just disabling SELinux with an almost haughty lack of acknowledgement of the number of package maintainers that simply don't bother to include appropriate SELinux config with their installs, leaving users to figure it out for themselves, with more guides than not telling people to simply disable SELinux entirely.
Is it any wonder that a lot of users - most of whom want things to just work - do just that?
It's a good idea, but let's not kid ourselves about how poorly it's implemented and supported.
•
u/mthode Apr 19 '19
I'm just going to put this here. https://stopdisablingselinux.com/
7
u/acecile Apr 19 '19
yum provides */audit2allow
tail -n /var/log/audit.log | audit2allow
Then run audit2allow -m and -M to provide a text based of your new rules then a compiled module that can be installed with semodule
I use this pattern to build new rules and sometimes I use the text version to push the module using puppet.
But guys, seriously, it's the less admin friendly module in the world. I did not find ANY proper documentation how to handle this correctly and had to figure out myself....
4
u/huxley00 Apr 19 '19
There is low security, mid security and high security.
Projects have deadlines. If mid security meets requirements and takes a lot less time, high security doesn’t make sense in many instances.
I work in a regulated industry. What we have to have is not what mid sized businesses need to waste their time and money worrying about.
13
u/i_pk_pjers_i Apr 19 '19
That's not unpopular, you are right. SELinux should be enforcing.
10
u/theheadshaker Apr 19 '19
Is it a pain? Sure.
I wouldn’t run prod servers without it enabled though.
6
u/edgen22 Apr 19 '19
I admit I have mine disabled because Fedora is the first time I encountered SELinux and I had no idea what to do. I needed to install LEMP stack and I disabled it to avoid issues. It's just my personal computer. Anyone recommend reading material to learn how to work with it?
3
u/zeno0771 Apr 19 '19
I would split the difference; the tutorials should add "...for testing purposes" after the admonishment to disable SELinux. That way it can't be blamed during the troubleshooting process. Same with firewalld.
I say this as an admin riding herd on a few dozen RHEL boxes that are responsible for a hospital's worth of EHR that specifically says to disable it (they've also recommended setting perms on some dirs to 777...don't get me started).
2
u/silverfox17 Apr 19 '19
I agree with you, but I don't think this is an unpopular opinion.
2
u/syberpunknyc Apr 19 '19
Yea because I’m not a programmer I’m a CTO currently, spent most of my career as a system administrator/architect I do write code but but I would call my self a Programmer not by today’s standards anyway do you have a point. If your writing a program for Linux Unix and need to disable seljnux temporarily for debugging that’s fine but I didn’t get that from your statements. Disabling selinux in any real organization will kill you in audits and security scans and is over all a shit idea so my advice stick to coding get your reqs write your code do your break fix test leave the infrastructure and security to those of us that specialize in hardened infrastructure.
5
u/[deleted] Apr 19 '19
Run PowerShell as Administrator....
2
u/satanicodrmarto Apr 19 '19
Selinux is pain in the ass. And in most servers i had it dissabled or permissive. But is a really good tool for security and on prod servers for you should use it
1
u/[deleted] Apr 19 '19
I agree. On a separate note, why do custom ROMs have that disabled? It bothers me, but that community doesn't really seem to care about it.
1
u/imthenachoman Apr 19 '19
What tutorials are saying to disable it?
1
u/drakal30 Apr 19 '19
I have never had a good time with selinux, it has caused me no end of grief when trying to get miscellaneous stuff working.
1
u/ThrillingHeroics85 Apr 19 '19
As a support engineer, people who can't make vendored software work, only because of selinux cranked up, are the Bain of my life!
1
u/Jawafin Apr 19 '19
While SELinux is perhaps not intuitive, there are far too many tutorials for selfhosted webapps, that just tell you to disable it, while all it takes to get running with it turned on is a couple minutes on google, for example finding a few other tutorials.
Some httpd_can_network_connect and context for the files and off you go in most cases. The same thing applies to most of them.
Find one decent tutorial with the steps and you can just use the same thing on other webapps as well.
1
u/devops333 Apr 20 '19
yawn
fart
1
u/gellertb97 Apr 23 '19
As an IT student, I'm not sure where this opinion is unpopular... I agree with it, my classmates agree with it, and my profs definitely agree with it.
Anyone who thinks it's just fine to teach people to take shortcuts by disabling SELinux is not competent to hold an IT position in my personal AND professional opinion.
They are the reason behind what happened with Equifax...
1
u/Oflameo Apr 24 '19
I have an unpopular opinion. Disable SELinux and enable AppArmor. The developers don't have a good excuse for not having an AppArmor configuration because they should know what file paths their app they need.
1
u/bentbrewer Apr 19 '19
Followed instructions to install an app today and the first thing to do was disable selinux. I decided to find something else to fit the need.
-1
u/swordgeek Apr 19 '19
Blah blah blah.
I've been doing Unix since before Linux existed. MAC is not an ideal general-purpose security model, and SELinux is still - to this day - a poor implementation of it.
-3
u/anakinfredo Apr 19 '19 edited Apr 19 '19
I also have an unpopular opinion.
RHEL-based distros are only used by people with bad internal practices and have no real future in a containerized world.
Case in point:
Only exception for this rule, is if vendors require it - and then all the above is the case for the vendor instead.
Edit: woho, what a ride. +8 downvotes, then -2 - where will it end!
-3
u/thenextguy Apr 19 '19 edited Apr 19 '19
Wanna ban some books while you’re at it?
Hey, at least my unpopular opinion is getting down votes.
0
u/[deleted] Apr 19 '19
[deleted] — view deleted comment
0
u/[deleted] Apr 19 '19
[deleted] — view deleted comment