Replies: 3 comments 5 replies
-
|
I think this is what userns=auto is for. It gives your process a random uid/gid that outside the namespace has no rights, as it doesn't exist. And the next time it's run, it might get a different uid/gid. |
Beta Was this translation helpful? Give feedback.
-
|
I dont see my way through this. To create an ephemeral user, do you need root level privileges? That kind of defeats the purpose. The next obvious step might be to run libkrun or kata containers where you would be sandboxing? |
Beta Was this translation helpful? Give feedback.
-
|
I would say external user management is not in scope for podman. The reason DynamicUser=yes does not work is because they lock that user down, it has no systemd user session, it has not subuid/subgids assigned and so on. For podman specially we need to store images with the subuid/subgids on disk so you cannot really chnage thoose later as the files are on disk, so dynamic uid/gid assignment would break any persistent storage. If your goal is to just have some tooling to create a user per container you like to run as service then I do not think that is something we would want in podman directly and rather external tooling/scripts. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I love the idea of rootless podman, running as quadlets, as I want to protect against container escape gaining root.
That said, I also want to protect against container escape having access to my user account/files. I also don’t want to rely on a specific user in my organisation (e.g. user “alice”) to run the containers (what if Alice quits the company?). This leads you to create a dedicated user for running containers (e.g. a “containers” or “oci” user).
Then again, I also want to protect against container escape having access to my other containers. This leads you to create a dedicate user for every container/pod (e.g. separate “wordpress” and “postgres” users).
This is similar to the issues faced when running traditional system services, and systemd solved these with DynamicUser.
http://0pointer.net/blog/dynamic-users-with-systemd.html
This post suggests the systemd DynamicUser feature is too restrictive for running containers.
#12424
I think having a similar feature for podman would be great - enabling ephemeral users for rootless containers, that are configured by users with administrative/sudo privileges.
Is anyone working on this, or has it been considered in the past?
Beta Was this translation helpful? Give feedback.
All reactions