Live data from Hacker News

SELinux is unmanageable; just turn it off if it gets in your way

ctrl.blog

31–40 of 461 posts

Re: SELinux is unmanageable; just turn it off if it gets in your way

#31

Like others here, I had a similar experience. I setup a simple minecraft server on a SELinux secured OS. So far, so good. I wanted to setup a systemd service to startup and shutdown the minecraft server. After ~1 hour of work later, I came to the conclusion that I was going to disable SELinux. Another hour later, I disabled SELinux. Much as the article mentions, there didn't seem to be much good help, especially w.r.…

Apparmor is -much- easier to write policies for; even more so if you use one of the ubuntu based distros that have decent rules already set up for most apps you'd use.

Re: SELinux is unmanageable; just turn it off if it gets in your way

#32
The gist of the problems is that the policies are not transparent (probably due to security reasons?) to the user/admin, did I get that right? And that there's a difference in enforcement between user policies and policies provided by the distribution?

All this sounds to me like a good idea that got lost in the implementation.

If you have no way to look up which policies are in effect and what is labeled and how, something that even Windows 10 gets right, then yeah. SELinux is a toxic mess.

Re: SELinux is unmanageable; just turn it off if it gets in your way

#33
Longtime SA, constantly ribbed or outright insulted for my absolute hatred of SELinux. Yes, I just turn it off first thing. Well, used to when stuck with RHEL environments.

If you want people to adopt and really use something at large, you need to make it simple, explain when and why it's useful, and document it well. SELinux doesn't do any of that particularly well.

And now that most things are effectively running on a vm inside a vm, the use case seems dwindling even further.

I for one will not miss it.

Re: SELinux is unmanageable; just turn it off if it gets in your way

#34
How can I trust some opaque policy I cannot see? Not just trust that it is well intentioned not evil, (Oracle Linux?), but that it does what it says. And does what I need and that the opaque developers have correctly envisioned what I need to do.

Security by obscurity is worse than none at all. Security by buying an "Enterprise" product is worse than that.

What SELinux says is "real MAC security is super complicated, but don't worry we've taken care of all that for you, but you can't understand it or change anything". What I say is "easy peasy; if you access the machine you're root. Make sure that either it doesn't happen or it doesn't matter".

Re: SELinux is unmanageable; just turn it off if it gets in your way

#36
post #11

Earlier quoted context omitted.

There's something funny about a website about teaching security practices being unavailable through HTTPS. It looks like the website is hosted by github pages, and the author didn't bother setting up SSL correctly.

Is there anything on the site that needs to be secured with TLS? There's no authentication, no user details, why would it need to be secured?

Using HTTP leaves you open to being mitm'd, for one.

Re: SELinux is unmanageable; just turn it off if it gets in your way

#37
Operating system security was important back before VMs became cheap. At this point you are really wasting time if you invest significant effort in host security. It's the new network security.

Separate concerns into VMs and network connections separated by strong authentication, authorization and encryption, and practice least privilege. It doesn't matter if your OS or containers are made of security swiss cheese as long as compromising one thing doesn't lead to compromising another. For containers you need Firecracker VMs; there is no other strong isolation for Linux containers, everything else is pretty easy to pop.

Re: SELinux is unmanageable; just turn it off if it gets in your way

#38
I have to say, for sysadmin work I find this view sorta overblown.

My experience is with RHEL and derivatives, not Fedora, and for the most part those are very straightforward and while selling does rear it's head every once in a while, it's usually not that problematic to work around.

When you have something failing that you need to fix and isn't an upstream problem (i.e. your own app or some third party vendor), you set the system to permissive mode and let it run with the app long enough that you think you've hit all the use cases, and then you use ausearch and audit2allow to generate a module for it. And bi, while the selinux audit log entries (which ausearch shows) aren't super clear, you can learn to interpret the gist of them, and piping them to audit2why and audit2allow gives more context.

The real "trick" in the above is to make sure you run the system in permissive mode for a while. Otherwise you'll usually only see the first deny in a code path which the app will then fail on, and you won't see subsequent ones. Permissive mode means nothing is actually denied, but all thing that would be denials are logged as such.

For things that ship with the OS repos for RHEL and derivatives, my experience is that very rarely are there problems or things that are not obvious to fix (running errors through audit2why will tell you when there's a boolean to toggle to allow what you want, such as outbound tcp connections from the http context that is causing some PHP app to malfunction).

Re: SELinux is unmanageable; just turn it off if it gets in your way

#39

My advice is to ALWAYS turn it off. As soon as you install a new system, turn it off (together with systemd).

> turn it off (together with systemd)

How practical is just turning off systemd today? I hate it too, but hasn't Red Hat basically strong-armed so many important Linux components into adding a hard-dep on it that your only way of avoiding it is to use a distro purpose-built to (e.g., Devuan)?

Post reply on HN