• keisatsu@infosec.pub
    link
    fedilink
    English
    arrow-up
    27
    ·
    1 day ago

    Adding a user to the docker group is equivalent with granting it passwordless root privileges, never do that unless you know precisely why and understand the risks involved.

    On the positive side, forbidding password-based auth, installing and using a firewall and locking down the root account is good advice

    • MalReynolds@piefed.social
      link
      fedilink
      English
      arrow-up
      6
      ·
      1 day ago

      Getting whatever you can (likely most, or all) into rootless podman, preferably with SELinux is worthwhile. Docker is a security nightmare.

      • galaxy_nova@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        24 hours ago

        I have a whole bunch of docker compose declared containers running on my server how much of an investment do you think it’d be to podman? I don’t like how insecure docker is but it seems like a pain to move.

        • MalReynolds@piefed.social
          link
          fedilink
          English
          arrow-up
          4
          ·
          edit-2
          22 hours ago

          Not going to lie, there is pain, but maintenance is much nicer. I’ve gotten to the point where I can just convert docker-compose to quadlet by eye, the syntax is familiar if you know systemd.

          https://github.com/containers/podlet can be pointed at a docker-compose and spits out quadlets. It’s been a while but last I used it, it would get it right 80%+ of the time on complex things and get you 85%+ there when it failed. There’s also podman-compose which is a crutch but can establish compatibility. /usr/libexec/podman/quadlet -dryrun -user is a useful diagnostic when conversions break.

          • galaxy_nova@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            18 hours ago

            Sometimes I feel like a poser Linux user because I don’t know systemd at all lol. I guess it’s probably because it’s technically my secondary os. But yeah I’ll look into changing stuff this weekend. I’ve been having issues with tangled, and I want to self hosting my password manager so it’s a good time to just put in a bunch of effort into everything. I’m hoping that podman will also be a bit more ergonomic.

        • bitfucker@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          23 hours ago

          Honestly the issue is docker was never designed to be a security boundary. Docker is always from the beginning a way to deploy application without conflicting shared library requirements. Looser than isolation of VM, but also not as hard as every other existing solution at that time (dedicated chroot, static linking, appimage, flatpak)

          • galaxy_nova@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            18 hours ago

            Yeah makes sense. I originally just went with docker because I didn’t want to bother to learn new stuff since spending hours solving issues at work made me less inclined to want to do the same at home when I just want to actual maybe work on “fun” stuff. Same reason I still use nginx instead of caddy. But I have seen increasingly more projects that use podman instead of docker so maybe I can still be lazy ish with my self hosting and get some security.

            • bitfucker@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              18 hours ago

              That’s the fun part. Podman skills transfer better to kubernetes if that’s your end goal. Docker compose has a different format than what a kubernetes YAML expect. So you do get a bit safer container model AND devops skills

  • lntl@lemmy.sdf.org
    link
    fedilink
    arrow-up
    6
    ·
    1 day ago

    I would add changing the SSH port to one that isn’t 22. This isn’t any more secure, but does tamp down on automated scanner traffic.

    • exdor@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      11 hours ago

      You can also add endlesssh behind port 22 to slow down attackers, and of course install fail2ban

      • lntl@lemmy.sdf.org
        link
        fedilink
        arrow-up
        1
        ·
        4 hours ago

        keys are more than enough for security but keya doesn’t reduce automated scanner traffic at all. for each automated scan, the server will open a connection and attempt to authenticate the client which consumes resources and spams logs. When I switched to a different port, my automated scanner traffic dropped to essentially zero.