I’m getting ready to rebuild the home server and was going to go back to fedora server, but I’m seeing a lot of interest around NixOS lately and figure this might be a good opportunity to learn about it.

But I’m concerned about security in this system. It seems to have no fully functional SElinux or apparmor layer so any long running services that talk to the internet would be left in a vulnerable state without that fallback layer of protection.

Am I being paranoid here?

  • erer@lemmy.zip
    link
    fedilink
    arrow-up
    1
    ·
    2 hours ago

    Ubuntu server + unattended updates + live kernel updates and forget about it.

    You shouldn’t be touching the base of your home server, use container or VMs on top for your applications

  • SavvyWolf@pawb.social
    link
    fedilink
    English
    arrow-up
    7
    ·
    6 hours ago

    If I may provide an alternate perspective: Having your entire server’s config in a single source controlled space makes it easier to see what is running and what isn’t, as well as how everything is configured.

    Security issues sneak in via the cruft that develops over time as server config mutates and changes in random config files scattered across the disk.

  • captain_teebs@piefed.social
    link
    fedilink
    English
    arrow-up
    3
    ·
    9 hours ago

    You can try just the Nix package manager for a while and see if you like it. I wanted to switch to Nix so I could create one declarative config for all my servers and update that from my dev machine instead of tracking stuff on each server. Nix worked pretty well for that, but I use rootless podman and quadlets extensively on one server, and the files for those are already in a Codeberg repo, so the marginal gains when switching to Nix were minimal for me. It did achieve what I expected, it just didn’t make a lot of sense for me to go from Nix package manager to NixOS. YMMV depending on your use case.

  • hendrik@palaver.p3x.de
    link
    fedilink
    English
    arrow-up
    3
    ·
    10 hours ago

    NixOS is nice and quite unique compared to something like a Fedora server. Make sure to try it first. There’s a lot to learn and the learning curve is steep. And oftentimes it’s weird quirks and specifics you’d learn. Not some general Linux knowledge.

    I think whether someone wants or needs SELinux or Apparmor is a case by case decision. That depends on your threat scenario and what software/services you’re running. I’m not sure if it’s of any help considering the average attack and issues on a home server with services like Nextcloud and Jellyfin running.

    • muusemuuse@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      4 hours ago

      Well, I’d like to leave something like I2P, reticulum, or bit torrent running overtime. It’s constantly talking to things on the outside world, so I’m trying to figure out how proactive I need to be about that

      • hendrik@palaver.p3x.de
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 hours ago

        Hmmh. I’m just not sure if either SELinux or Apparmor address issues with something like those projects. I mean they’re established open-source projects with a larger userbase and should be somewhat okay?! They shouldn’t call other executables and don’t need elevated privileges to run (and there’s other ways to contain these kinds of issues). And they’re doing all kinds of network connections anyway, so not sure if you can even restrict those networking platforms in any meaningful way?!

        • muusemuuse@sh.itjust.worksOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 hours ago

          There’s a couple ways to do it but I’m not great at container networking and tossing it into a VM with. Seperate physical Ethernet jack is more of a blunt instrument than I wanted. Really it’s more of an exercise to improve my skills than anything else.

          • hendrik@palaver.p3x.de
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            8 minutes ago

            Sure. What I mainly do is use seperate user accounts for all the services so they can’t access each other’s data. That’s also what Linux distributions do anyway when setting up server software. I try not to give them any extra privileges and use whatever SystemD services offer to restrict stuff. I’ll make database access as strict as possible. Disable unneeded stuff, unnecessary open ports and then focus on having appropriate passwords, fail2ban and timely updates. I run most stuff bare metal and only use containers and VMs if it makes it easier or I feel it’s more risky than usual. I think that’s somewhat alright for a home server setup.

  • ShutUpWesley@piefed.zip
    link
    fedilink
    English
    arrow-up
    10
    ·
    16 hours ago

    I’ve enjoyed NIX, but I’d play with on a spare system or VM before using it on anything you need to be reliable, as it has lots of quirks that are good to know about before dailying it. I’d check out Vimjoyer on the tube if you haven’t already.

    As for SELinux and AppArmor, how important that is really depends on your setup, it’s not something I personally concern myself with much, but I maintain as small an attack surface as possible.

  • nixos_fan@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    14 hours ago

    You can use systemd hardening to secure your services. There are also nixos containers, although I haven’t delved into them and can’t tell you much about them. You can also deploy oci containers in various ways (I’d recommend quadlet-nix).

    • muusemuuse@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      13 hours ago

      I do have some containers I was going to deploy, though those I’m going to need to crash course rootless vs rootful security vs network complexity and performance, but the general idea of this is I can just leave it alone and if something compromises it, the blast radius will be limited until I notice and catch it on the firewall doing something sus

      • nixos_fan@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        11 hours ago

        The best way to limit the blast radius would be to have separate physical hardware per service, so there is always a tradeoff.

        I’m not sure what your questions and goals are, how do you currently deploy applications? Playing around with quadlets is probably the best idea here

        • muusemuuse@sh.itjust.worksOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          4 hours ago

          I have one virtual machine for home assistant. I’m trying to break down into containers like the other services I have running on here because the idle power consumption has always been higher on this Ryzen rig with the virtual machine than idle containers. It also means if home assistant has to compile new firmware, it can use all available cores and RAM that it needs and then give it back when it’s done. Would that have to worry about borrowing resources and maybe or maybe not giving them back afterward like it would with a VM