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
    link
    fedilink
    English
    57
    edit-2
    2 months ago

    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.

    • @marauding_gibberish142@lemmy.dbzer0.comOP
      link
      fedilink
      English
      92 months ago

      Exactly. I use setroubleshoot myself and it’s awesome.

      I agree that creating custom policies for a bunch of apps day in day out will be tiring. But that is an argument against all MAC. I personally don’t want to see Linux going the way of abandoning MAC

    • @med@sh.itjust.works
      link
      fedilink
      22 months ago

      Is it not possible to run it in audit mode in dev and have it tell you what the would have blocked?

      • DigitalDilemma
        link
        fedilink
        English
        22 months ago

        Permissive mode, and yes, you absolutely can. That shows warnings but doesn’t actively block. But you still benefit from running setroubleshoot to actually figure out what and why it’s blocked something, and how to mitigate that.

        Permissive is also good in that you can get a bunch of blocks reported at once, instead of having to step through one at a time, which can be useful.

        • @med@sh.itjust.works
          link
          fedilink
          22 months ago

          That’s what I was thinking, I know the pain of watching something run for ages, only to finally get past where it failed last time and run straight in to another stumbling block.

          I don’t envy you having to work in an SELinux environment with less than stellar developer understanding of policies and contexts.