I’m new to the container world. Does it have any security benefits when I run my applications as a non-root user in a docker container? And how about Podman? There I’ll run the container as an unprivileged user anyway. Would changing the user in the container achieve anything?

  • loudwhisper@infosec.pub
    cake
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    I have seen this post and decided to respond via a separate blog post. https://loudwhisper.me/blog/containers-isolation/

    The short answer is that yes, they do. And yes lowering the privileges of the user helps in avoiding container escapes, which basically makes the other advantages for containers valid. You can, however, achieve the same using (relatively obscure, imho) systemd settings, running with flatpak etc. Namespaces + Cgroups + Seccomp + Capabilities = better security. Containers make it easy to use all of the above.