• IronKrill@lemmy.ca
    link
    fedilink
    English
    arrow-up
    28
    arrow-down
    1
    ·
    2 days ago

    Well that sucks. IIRC a lot of my docker images are alpine based, but they’d be safe due to never having their SSH ports exposed I assume.

    • fonix232@fedia.io
      link
      fedilink
      arrow-up
      25
      ·
      1 day ago

      Why would you even have an SSH server running in a Docker container (unless the purpose of the container is being a jumpbox or similar)?

      I can’t emphasise it enough how much more secure you get when you use rootless, read-only containers that are limited to truly just the software you want to run and its dependencies.

      Alpine is great for dev containers, but the final container should be:

      • immutable on the app layer (any executable path needs to be read only)
      • have only the absolutely necessary GNU tooling, service management, etc. included (for most software you don’t even need these tools, and why would you give an attacker who gain access to your container, an easy way to e.g. scan your network?)
      • only the data mounted, rw only if absolutely necessary (e.g. if you host a Jellyfin server, just an example, you should have the mounted media be RO, and only the config and caches be writable, mounted noexec of course)
      • IronKrill@lemmy.ca
        link
        fedilink
        English
        arrow-up
        8
        ·
        1 day ago

        While I have not done it, I could see it being appealing as it’s quicker than SSHing into the parent box first for a commonly used tool. I had a direct SSH into a systemd container for a while before deciding the extra config wasn’t worth it.

      • MonkderVierte@lemmy.zip
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 day ago

        unless the purpose of the container is being a jumpbox or similar

        What’s wrong with a rootless jumpbox?

        • fonix232@fedia.io
          link
          fedilink
          arrow-up
          3
          ·
          1 day ago

          Nothing, my point was that SSH in a container is unnecessary unless it’s for the specific purpose of the container.