There was a recent post about whether to enable ufw and it made me ask: how protected I am from a rogue docker container? I have a single server with 15-20 docker containers running at any given time. Should one get hacked or be malicious from the get go, are there (hopefully easy to implement for an armchair sysadmin) best practices to mitigate such an event? Thanks!

  • shardul-@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Noob here, What if we use something like authelia or authentik for signing in to use any container. Will that make it safe?

    I saw it the documentation of r/CosmosServer the creator mentions how his setup does not allow docker containers to talk to each other.

    • isleepbad@alien.topB
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      “Only” having an authenticator doesn’t stop malicious containers from reaching outside. Least privileges and network segmentation is the minimum necessary.

    • Accomplished-Lack721@alien.topB
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Safe-r. Not inherently safe. It’s one good practice to consider among others. Like any measure that increases security, it makes your service less accessible - which may compromise usability or interoperability with other services.

      You want to think through multiple security measures with any given service, decide what creates undo hassle, decide what’s most important to you, limit the attack surface by making unauthorized access somewhere between inconvenient and near-impossible. And limit the damage that can be done if someone gets unauthorized access - ie not running as root, giving the container limited access to folders, etc.