Isolation: allowed the use of credentials with unpriv userns.

The setuid/setgid syscalls requires root capabilities but if the kernel
supports unprivileged user namespace then the child process has the full
set of capabilities in the new namespace, then we can allow setting "user"
and "group" in such cases (this is a common security use case).

Tests were added to ensure user gets meaningful error messages for
uid/gid mapping misconfigurations.
This commit is contained in:
Tiago Natel
2019-12-06 16:52:50 +00:00
parent ed2492a66a
commit 411daeaa53
13 changed files with 1187 additions and 152 deletions

View File

@@ -5,6 +5,7 @@
NXT_ISOLATION=NO
NXT_HAVE_CLONE=NO
NXT_HAVE_CLONE_NEWUSER=NO
nsflags="USER NS PID NET UTS CGROUP"
@@ -42,6 +43,10 @@ if [ $nxt_found = yes ]; then
. auto/feature
if [ $nxt_found = yes ]; then
if [ $flag = "USER" ]; then
NXT_HAVE_CLONE_NEWUSER=YES
fi
if [ "$NXT_ISOLATION" = "NO" ]; then
NXT_ISOLATION=$flag
else