• Phoenixz@lemmy.ca
    link
    fedilink
    arrow-up
    13
    ·
    1 day ago

    I’m. amuxh bigger fan of apparmor. Easier to configure, easier to debug, easier to fix, and as far as I know it gives the same level of security

    • slazer2au@lemmy.world
      link
      fedilink
      English
      arrow-up
      75
      ·
      2 days ago

      Because developers are bad at using it. How many times have you seen a installation instructions telling you to turn it off

    • comador @lemmy.world
      link
      fedilink
      English
      arrow-up
      48
      arrow-down
      5
      ·
      2 days ago

      selinux relies on the basis of deny all, allow only ideas. On paper that’s fine, but when you are troubleshooting issues, installing software or developing applications, it can hinder productivity by preventing the user from doing things.

      Selinux CAN work, but it absolutely requires a lot of time investment and maintenance to keep it working well with audit.d and general logging.

      • exu@feditown.com
        link
        fedilink
        English
        arrow-up
        16
        arrow-down
        3
        ·
        1 day ago

        I might get down voted for this, but I’ve honestly found LLMs pretty useful tools for debugging SELinux.

        • LH0ezVT@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          6 hours ago

          Ironically, SELinux might be a pretty good tool to keep LLMs from accidentally getting the answers to their benchmark

      • Martineski@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        2 days ago

        I wish I could set up SELinux but NixOS doesn’t support it… I already do something similar where all files on root are wiped by default (E: on each boot) and I have to opt things into persistence so it’s definitely something that I’d like.

    • FlexibleToast@lemmy.world
      link
      fedilink
      English
      arrow-up
      15
      arrow-down
      5
      ·
      2 days ago

      Because apparently people are stuck in the mindset of about 10 years ago when people used to get tripped up over it. SELinux is rarely ever a problem for anything these days. This post is dumb.

      • jj4211@lemmy.world
        link
        fedilink
        arrow-up
        8
        ·
        1 day ago

        While the stock policies have been refined to model more of an average user’s usage, the facility itself remains a PITA when people do trip over it. File operations that mess up contexts, use cases that don’t quite fit the policy, use cases that are well recognized but SELinux blocks it by default anyway until you change an sebool.

        By being a security mechanism bolted on after the fact, various operations fail in ways that are mysterious because they can’t inject explanatory information into the failure path. Further the audit log that you pretty much always need to consult when something fails for mysterious reasons in case it might be SELinux isn’t even readable by the user that got dinged. So I can’t even code in a way to check if SELinux was the reason and guide the user, instead I have to provide a diagnostic utility they have to ‘sudo’ to explain to them, or be vague and say 'check if selinux is somehow involved. So I end up despite doing my damndest to not run with privilege asking users to run something with privilege to check a security mechanism.

        The existence and usage of audit2allow is a big sign of problematic design. How to fix something you see in auditlog is hard for people to understand, so they just audit2allow to amend policy, but instead they should have done a chcon because now they have a crap rule allowing something they shouldn’t, but SELinux is still enabled so all good!

        The whole label based concept is a fun whole other dimension of things for people to worry about. Messed up so often that we have a nice convenient ‘restorecon’ to basically apply the way AppArmor does things to the filesystem in that moment.

        The curve could follow someone’s journey with complexity, starting out with the prejudice that SELinux is bad, then letting SELinux happen and noticing no issues, and then moving on to realms where they actually have to touch the goop of SELinux instead of the canned distro SELinux setup covering their use case.

        • Seralth@piefed.seralth.com
          link
          fedilink
          English
          arrow-up
          4
          ·
          1 day ago

          Over the last year I have done this entire. Went from app armor to SEL and now I’m back on app armor.

          You couldn’t pay me enough to try SEL again.

          • jj4211@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            1 day ago

            Yeah, AppArmor is a lot more straightforward. I could buy an argument that technically the SELinux approach is more flexible, but it’s hard to imagine someone needing that much flexibility in the general use case.

            I can understand why something like Android could get more mileage out of SELinux’ model, but most scenarios are very capably modeled by AppArmor approach and much easier and less fragile functionality wise.

            • BlueKey@fedia.io
              link
              fedilink
              arrow-up
              1
              ·
              16 hours ago

              In some usecases SELinux is less flexible:

              You have two applications installed which bring their own labels and rules, lets say app_a_t and app_b_t. Now you want to give AppA read access to only one specific directory of AppB data (which is labeled app_b_t).

              How to do that? Writing a rule allowing acces between the labels would give AppA access to all of AppB data. Creating a new label for this specific dir would break AppB as it relies on the rules for app_b_t.

              My biggest issue with SELinux is that files and applications can not have multiple types at once (like with a role based model).

    • Seralth@piefed.seralth.com
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      4
      ·
      1 day ago

      It assumes the user is an idiot. And it assumes the user should not own their own device.

      That is the core tenant of how it works.

      Aka deny all base line.

  • halvar@lemy.lol
    link
    fedilink
    arrow-up
    16
    ·
    1 day ago

    It’s both. If you have a deployment where everything works and you didn’t have to disable it or restrict it a lot then obviously it’s very good to have. The problem is with reaching this state where everything works and selinux is also enabled.

  • Turret3857@infosec.pub
    link
    fedilink
    English
    arrow-up
    14
    arrow-down
    5
    ·
    1 day ago

    android uses selinux and android is used as the base for one of the most secure OSes in the world.

      • Possibly linux@lemmy.zip
        link
        fedilink
        English
        arrow-up
        4
        arrow-down
        2
        ·
        21 hours ago

        SELinux is a critical part of the least privilege model of a Android system. It is why Android hasn’t been impacted by almost all Linux CVEs. Unlike desktop Linux, Android was created after modern security threats were around. Overtime the system has been partitioned so that a compromise in ome area doesn’t impact others. It isn’t flawless but it does a pretty good job.

    • khánh@lemmy.zip
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      1 day ago

      selinux has, is, and will always be a fucking pain in the ass for us custom rommers

      • Possibly linux@lemmy.zip
        link
        fedilink
        English
        arrow-up
        4
        ·
        21 hours ago

        Don’t disable SELinux

        It breaks the entire Android security model. Your device will become highly vulnerable as apps will have full access to everything. All it takes is a browser exploit and you are cooked.

    • Seralth@piefed.seralth.com
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 day ago

      I have come to the general understanding that unless you have a million dollars on the line and a million more dollars to give to one person to manage it.

      Just use app armor