You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, crun sets the "no new privileges" flag to true, which prevents using suid binaries like sudo inside containers. dockerc does not allow modifying this flag.
ssh -p 2222 apt42@localhost
apt42@localhost's password:
...
$ sudo -l
sudo: The "no new privileges" flag is set, which prevents sudo from running as root.
sudo: If sudo is running in a container, you may need to adjust the container configuration to disable the flag.
Fix
This can be solved in the same way as #52 , by modifying src/main.zig and passing the flag to crun:
ssh -p 2222 apt42@localhost
apt42@localhost's password:
...
$ sudo -l
sudo: unable to resolve host umoci-default: Name or service not known
Matching Defaults entries for apt42 on umoci-default:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, use_pty
User apt42 may run the following commands on umoci-default:
(ALL) NOPASSWD: /usr/bin/gawk
By default, docker/podman allows "new privileges", so, to avoid confusing users, dockerc should probably do the same.
The text was updated successfully, but these errors were encountered:
nollium
changed the title
"Sudo" and other suid binaries cannot be used inside the container
"Sudo" and other suid binaries cannot be used inside containers
Dec 29, 2024
Hello,
By default, crun sets the "no new privileges" flag to
true
, which prevents using suid binaries like sudo inside containers.dockerc
does not allow modifying this flag.POC
Dockerfile:
Running sudo
Fix
This can be solved in the same way as #52 , by modifying src/main.zig and passing the flag to crun:
After this fix, the "expected" behavior is met:
By default, docker/podman allows "new privileges", so, to avoid confusing users, dockerc should probably do the same.
The text was updated successfully, but these errors were encountered: