Which puppylinux kernels have "user namespaces" enabled? It might be useful.
BarryK wrote:Oh, one other important point. You need to have a Linux kernel with namespaces support. Some Puppy kernels, including Quirky, do not have this.
I am currently using kernel 4.4.44, configured as shown here:
http://barryk.org/news/?viewDetailed=00500
Fatdog64 should be OK. Fatdog64 has aufs, probably not overlayfs (I haven't checked, just guessing).
http://murga-linux.com/puppy/viewtopic. ... 772#940772
However @BarryK seems to later contridict this:
BarryK wrote:EDIT 2018-10-8
Reverted, going back to the 4.14.73 kernel with user namespaces disabled. Will keep it disabled for future compiles of the kernel. Have been reading some more, and user namespaces seem like asking for trouble. Plus, as already running as root in Easy, there doesn't seem much point in having user namespaces.What I do want to be able to do is optionally run as user 'zeus' in containers. I was unable to get pflask to do that. rather than get tied up trying to "fix" pflask, perhaps this is a satisfactory workaround:
# pflask -- chroot --userspec=zeus:zeus /mnt/sdc2/containers/sh0/container whoami
zeusWell, that's a starting point, but has limitations. If pflask drops capabilities, will have to make sure that still has the capability to do a chroot and change user:group -- which, oddly, may mean zeus will end up with more capabilities than the "crippled root" -- though, a start-script in the container could drop more capabilities.
Also, the full 'chroot' from 'coreutils' package is required, as the busybox applet does not support that commandline option.
https://bkhome.org/news/201810/kernel-4 ... paces.html
I'm trying to find a kernel suitable to run pflask on puppylinux. pflask seems to run on Fatdog64 and EasyOS but not necessarily on puppylinux. The error I get is "write(gid_map): Operation not permitted" (see post). Installing the package uidmap, didn't seem to resolve this issue.
While trying to solve this issue I came across a number of kernal parmaters that may or may not be relevent.
/proc/sys/kernel/unprivileged_bpf_disable (Configurable on Fatdog64). Mentioned at:
1 - github.com/lxc/lxc: Can't start unprivileged containers on 4.9 kernel with OpenWRT #1923
2 - nsfocusglobal.com: Linux Kernel Information Disclosure and Privilege Escalation Vulnerability Threat Alert
3 - ycombinator: Linux 3.8 introduced unprivileged user namespaces [pdf] (man7.org)
7 - gitlab.com: Rootless docker guide
kernel.unprivileged_userns_clone -- Mentioned at:
4 - superuser.com/questions/1094597: Enable user namespaces in Debian kernel
5 - .stackexchange.com/.../303213: How to enable user_namespaces in the kernel? (For unprivileged `unshare`.)
6 - github.com/containers/buildah: Provide a better error message when user namespaces are not available #1068
Source #5 (How to enable user_namespaces in the kernel? (For unprivileged `unshare`.)) also mentiones kernel.userns_restrict. Source #1 (Can't start unprivileged containers on 4.9 kernel with OpenWRT #1923) mentions two kernel patches to get these kernel parameters:
JagadeeshPagadala wrote:After applying the two kernel patches from the two links below, the output of ls -al /proc/sys/kernel/| grep unpriv is
lxcuser@LEDE:~$ ls -al /proc/sys/kernel/| grep unpriv
-rw-r--r-- 1 root root 0 Oct 3 11:09 unprivileged_bpf_disabled
-rw-r--r-- 1 root root 0 Oct 3 11:09 unprivileged_userns_clonelxcuser@LEDE:~$ cat /proc/sys/kernel/unprivileged_userns_clone
1lxcuser@LEDE:~$ unshare -U
-ash: setgid: Invalid argumentKernel patches taken from
https://lists.ubuntu.com/archives/kerne ... 67926.html
https://lwn.net/Articles/673990
https://github.com/lxc/lxc/issues/1923# ... -347109881
Here are some random links on sandboxing that came up on my search that people might find interesting:
Sandboxing Unsafe Executables on Linux for an Online Compiler with Minijail
http://www.oldforum.puppylinux.com OS Level Virtualization: Containers, chroot, cgroops jails,
https://chromium.googlesource.com/chromium/.../sandboxing.md
Here is an other interesting kernel parmater mentioned by BarryK but not related to sandboxing:
https://man7.org/linux/man-pages/man7/k ... own.7.html (mentioned in EasyOS 2.4.92 released, RC for 2.5)
Here are some manpages relevant to sandboxing (e.g. unsername mappings, cgroups, etc):
https://linux.die.net/man/5/cgrules.conf
Some more kernel documentation:
kernel.org/doc/html/latest/admin-guide: Namespaces compatibility list
kernel.org/doc/html/latest/admin-guide: Documentation for /proc/sys/kernel/