Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Allow --uid and --gid without --unshare-user when running as root #551

Open
DaanDeMeyer opened this issue Jan 27, 2023 · 2 comments · May be fixed by #616
Open

Allow --uid and --gid without --unshare-user when running as root #551

DaanDeMeyer opened this issue Jan 27, 2023 · 2 comments · May be fixed by #616

Comments

@DaanDeMeyer
Copy link

When root, it's not necessary to --unshare-user to be able to change uid/gid, so bubblewrap shouldn't require it.

@DaanDeMeyer DaanDeMeyer changed the title Allow --uid and --gid without --unshare-user when root Allow --uid and --gid without --unshare-user when running as root Jan 27, 2023
@rusty-snake
Copy link
Contributor

FWIW: --uid/--gid change the uid/gid by mapping the outer id to the specified id in the new user-ns (i.e. they do not call setuid/setgid).

@smcv
Copy link
Collaborator

smcv commented Feb 23, 2023

Do you have a use-case in mind for this? If yes, what?

A large part of the point of bubblewrap is that it works when you're not root. If you are root, there are lots of other ways to achieve similar results, like setpriv. Given its limited maintainer bandwidth (for the last year it has mostly just been me), I think we should keep bubblewrap somewhat focused on the things that can't be done any other way.

As @rusty-snake said, I don't think the way we are implementing --uid/--gid can work when not creating a new userns. If we have CAP_SETUID and CAP_SETGID, then we could have a different code path that does work without creating a new userns; but we would have to be very careful to make sure that an adversarial user couldn't make use of that code path to trick a setuid bwrap into opening up security holes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants