Namespaces

User Namespace & Related


Check

!#Check if it's enabled at Kernel Level
sysctl -n user.max_user_namespaces
#This will print a number
#if it doesn't or it's user.max_user_namespaces = 0, then it's disabled

!#Check if it's enabled/restricted Using unshare : https://man7.org/linux/man-pages/man1/unshare.1.html
unshare --user echo "Username namespaces supported"
#If Suporrted: Username namespaces supported
#If Not: unshare: unshare(0x10000000): Operation not permitted

!#Check if AppArmor|SeLinux is stopping us 
sudo dmesg | grep -E '(selinux|apparmor|security)'
#Look for lines containing words like denied, disallowing etc

Errors & Solutions

[WARN] Your kernel does not support user namespaces

[WARN] You mustEnableunprivileged_userns_clone

[WARN] You mustEnablemax_user_namespaces

[WARN] You mustDisableuserns_restrict

[WARN] You mustDisableapparmor_restrict_unprivileged_userns


Examples

Chrome/Chromium

Chrome Properly Sandboxed in User Namespace

Other Apps

Using lsns to see, Firefox is Properly Sandboxed in User Namespace

Last updated

Was this helpful?