Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow mixing userns=auto and userns=keep-id #24837

Closed
Jookia opened this issue Dec 13, 2024 · 3 comments · Fixed by #24882
Closed

Allow mixing userns=auto and userns=keep-id #24837

Jookia opened this issue Dec 13, 2024 · 3 comments · Fixed by #24882
Assignees
Labels
jira kind/feature Categorizes issue or PR as related to a new feature.

Comments

@Jookia
Copy link

Jookia commented Dec 13, 2024

Feature request description

Currently you have to pick between using userns=auto for every container you have or being able to keep-id which is useful for development containers. I'm hitting this issue with distrobox for example.

Using the following flag gets a working result:

--userns=auto:gidmapping=1000:0:1,uidmapping=1000:0:1,size=65536

Suggest potential solution

podman never promises the UID range in nomap or keep-id. Maybe these could use auto by default, or by a configuration flag?

Have you considered any alternatives?

The application using podman could instead be changed to use =auto. In my case I modified distrobox. However there's no way for distrobox to know whether to use =auto or =keep-id, especially since using the wrong one may affect other containers running on the machine.

Additional context

Using =auto has a significant security boost, it would be nice to have this as a rootless user.

@Jookia Jookia added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 13, 2024
@giuseppe
Copy link
Member

if I understand correctly the problem you are facing, you'd like keep-id to not use all the available IDs?

I think we could achieve it adding a size= option to keep-id, something like --userns keep-id:size=1024.

@Jookia
Copy link
Author

Jookia commented Dec 19, 2024 via email

@giuseppe giuseppe self-assigned this Dec 20, 2024
@giuseppe giuseppe added the jira label Dec 20, 2024
giuseppe added a commit to giuseppe/libpod that referenced this issue Dec 20, 2024
Introduce a new option "size" to configure the maximum size of the
user namespace configured by keep-id.

Closes: containers#24837

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
giuseppe added a commit to giuseppe/libpod that referenced this issue Dec 20, 2024
Introduce a new option "size" to configure the maximum size of the
user namespace configured by keep-id.

Closes: containers#24837

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@giuseppe
Copy link
Member

great, that is quite easy to add.

Opened a PR:

giuseppe added a commit to giuseppe/libpod that referenced this issue Dec 20, 2024
Introduce a new option "size" to configure the maximum size of the
user namespace configured by keep-id.

Closes: containers#24837

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
giuseppe added a commit to giuseppe/libpod that referenced this issue Dec 20, 2024
Introduce a new option "size" to configure the maximum size of the
user namespace configured by keep-id.

Closes: containers#24837

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
giuseppe added a commit to giuseppe/libpod that referenced this issue Jan 7, 2025
Introduce a new option "size" to configure the maximum size of the
user namespace configured by keep-id.

Closes: containers#24837

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
giuseppe added a commit to giuseppe/libpod that referenced this issue Jan 8, 2025
Introduce a new option "size" to configure the maximum size of the
user namespace configured by keep-id.

Closes: containers#24837

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Honny1 pushed a commit to Honny1/podman that referenced this issue Jan 13, 2025
Introduce a new option "size" to configure the maximum size of the
user namespace configured by keep-id.

Closes: containers#24837

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
FedeDP pushed a commit to FedeDP/podman that referenced this issue Jan 20, 2025
Introduce a new option "size" to configure the maximum size of the
user namespace configured by keep-id.

Closes: containers#24837

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
jira kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants