Live data from Hacker News

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

ctrl.blog

321–330 of 461 posts

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

#321

Earlier quoted context omitted.

It's pragmatism. If something doesn't work, it doesn't matter how secure it is.

If something isn't secure, it doesn't work. At that point, you would've been better off shipping a wireframe.

For you, no risk seems acceptable when it comes to security. That is generally not the case for most people, who will accept some level of risk (ie an insecure program) if it provides value to them. That's the whole point of risk management.

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

#322
post #307

Earlier quoted context omitted.

Honestly, the bigger issue is that most SWEs just aren’t very good. It’s extremely telling that when you spend time in tech forums most people dread system design questions as the harder side of interviewing for senior level SWE roles… System design, though, is the actual point of SW ENGINEERING. That’s the part that is responsible for creating a foundation of quality to build on. The other side is that sysadmins hav…

Maybe we're just in different circles, or perhaps have different definitions of system design, but that's not been my experience. Usually I see developers being very excited about system design and quite good at understanding system design questions - nothing's more fun than architecting a new system and thinking about stuff like scalability. Where people tend to fail is when they have to implement these systems, and…

>But I definitely think there's room for more comprehensive and transparent documentation to bridge the gap between the source code and barebones docs.

This is usually provided by technical books, which are available for a much wider range of systems than you'd think.

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

#323
post #243

Earlier quoted context omitted.

Docker actually comes with a seccomp and an apparmor config that bans many things by default. while it is absolutely not noticeable unless you are trying something like docker in docker. There are so many syscall that shouldn't even be relevant to normal programs.

That's why I explicitly mention "whitelisting". If you just want to ban some obscure syscalls and call it a day, you can do that. It will probably even be helpful to some degree. I personally think our aspirations should be higher than "let's ban ptrace(2)".

It's actually a bit more than that. The syscall docker allowed isn't really fixed. It is affected by what linux capabilities the container had granted. Like: if you whitelist the container about CAP_SYS_PTRACE, you probably also want ptrace(2) to be whitelisted. Instead of a all or nothing/your program will still break even cap added model.

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

#325
I tried SELinux perhaps too early and found that, unless I was right on the happy path, I simply couldn't get anything to run. I recall a feeling of victory after finally being able to multihost some websites. However, I am not a great sysadmin and was pressed into service at the time.

It feels good to know that I was not the only one.

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

#326
We've been implementing CIS hardening standards across our heterogeneous fleet of VMs for the last two years (Thank the maker for Ansible). When it came to evaluating the controls we would implement for L1, my team and our Security team negotiated which controls were appropriate for our environment. The first that I whacked was SELinux, and the Security guys couldn't understand why. In a greenfield environment where I had the time to run it in permissive mode and hopefully catch all the odd permissions it would require, maybe. A small maybe. But our environment has been around for decades, with apps that have transitioned across multiple teams, each time losing institutional knowledge.

Trying to implement SELinux on theses servers would be hugely disruptive, for minimal gain. Once I was able to explain the risk/reward calculation to the Security guys, they understood. Besides, we have so many compensating controls, I have no worries about expanding the attack surface slightly.

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

#327
post #101

Earlier quoted context omitted.

It's a terrible advice, i really hope he's not a system admin.

I run thousands of severs. None of them have SELinux or systemd. It’s banned tech.

No post body was provided.

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

#328

Earlier quoted context omitted.

which is why bridges and buildings certified by qualified engineers have never collapsed

Both types of structures have collapsed.

I guess, that person is just being sarcastic. However besides certification, qualification etc I think huge factor is cost of IT project is variable. And even worst failures are mainly delays, extra budget or moving work to different vendor/product. So companies can save money without endangering lives.

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

#329

Earlier quoted context omitted.

That's not really great advice either, temporary solutions/workarounds have a tendency of sticking around permanently.

I say this, because it's very hard to write the policy yourself at the beginning. So let the system run for a week and then use the tools to build the policy for you. I wish it's easier to sit down and write it, but it's not atm.

How does that work? If you run selinux without a policy, you also get no type transitions and no file labels. That means that after a week, you only have a list of things your system does, with every action coupled to the init_t domain (or possibly even kernel_t), and file access targeted at unlabeled_t (unmanaged_t?).

At the bare minimum, you need a base policy that already contains separate type contexts for each of your services, file contexts to apply to the service daemon binaries, and type transitions so that each service gets run in its proper context. If your daemons run in the wrong context, then immortalizing that in policy with e.g. audit2allow only deepens the swamp you're in.

I don't think there's any practical way to build an selinux policy from scratch by just running your system and recording it, even if the tools allow you to do that. You can only start from your OS' reference policy or indeed write the initial base policy by hand.

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

#330
post #301

Earlier quoted context omitted.

How does static linking increase workload?

By multiplying the number of potentially-vulnerable copies of a library by the number of ways to detect the presence of said library and by the number of ways to upgrade said libraries when found.

Plus, it makes updating an application way more difficult: you need:

- the distribution to recompile and test all binaries using a vulnerable dependency [x]

- users to download and update all affected binaries

compared to:

- the distribution patching a single package

- users updating that package

Imagine if OpenSSL was statically linked: even the smallest fix would require users to update half of the OS. And that would discourage both maintainer and users from doing regular updates.

[x] And this is assuming that thousands of automated rebuilds are possible. In reality many statically linked languages encourage locking the versions of build dependencies, making it impossible to do just one backport of a patch.

Post reply on HN