-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add SUID support #48
Comments
I feel like this would be pretty important... sudo is a major risk because the sudo password timeout counts across child processes. So on most Linux systems, by invoking a browser through vopono, we're handing the browser unchecked sudo privileges for 15 minutes. Demonstration of the issue:
It ain't looking good, doc. :( This issue is not really an "enhancement". |
I wonder if we can fix that specific issue by explicitly dropping privileges prior to launching the application, I really want to avoid extra forking and explicit system calls if I can though as it gets complicated to keep track of. But maybe we could do it in the pre_exec method of the The SUID bit itself is really a packaging issue as I can't do it for cargo installs for example, but at least could do it on the AUR, and possibly the deb packages if it it's supported there too. |
User-level cargo installs are broken anyway, as ~/.cargo/bin is dropped from path by sudo... I guess this should be its own issue, shouldn't it...? :D I think the prudent choice might be to just provide an error message that the vopono binary should be owned by root and have setuid bit. After some experimentation, it seems that sudo can be made a lot safer by adding this to /etc/sudoers: |
I think we run with the This actually simplifies the code too really, it's just a case of testing it and re-packaging the binaries (and updating the docs). |
On Ubuntu 20.04 at least, with the default sudo settings it's broken unless you manually copy the binary to /usr/local/bin or some similar location. With the binary in I guess for people installing from source, one can always put the chown/chmod stuff in the install.sh script, and debian packages can configure suid apps correctly. |
Allow user to set SUID on vopono binary, and then don't prompt for sudo, etc.
Most existing code should already work, this is more of a packaging problem. May need minor changes for getting original user ID - see https://github.com/Intika-Linux-Namespace/Netns-Exec/blob/master/netns-exec.c
Also consider using capabilities: https://linux.die.net/man/7/capabilities - if any applicable, e.g. CAP_NET_ADMIN
The text was updated successfully, but these errors were encountered: