EDIT: NOT removing this post as it is still informative. As @oleksandr (thanks) pointed out it has Russian binding. So probably going back to the drawing board and finding something else for Chrome.
My original post:
“During the post “uBlock Origin era”, I’ve came into conclusion that overall AdGuard fits the bill best:
@lkundrak @vegard getting rid of /dev was at least dead easy:
+# Debootstrap populates `/dev/{null,zero,full,random,urandom,tty}`, meaning that
+# mounting devtmpfs to `/dev` is not required.
sudo unshare \
--mount \
--uts \
--root "$ROOTFS" \
sh -c "
- mkdir -p /proc
- mkdir -p /sys
- mkdir -p /dev
- mount -t sysfs /sys /sys
mount -t proc /proc /proc
- mount -t devtmpfs /dev /dev
mount -t devpts /dev /dev/pts
hostname $MACHINE
# ...
I think I can iterate from this :-) E.g, proc-mount can be probably (I’d guess) made unprivileged with “–fork –pid” i.e., creating PID namespace.
Here’s an example:
sudo unshare \
--mount \
--uts \
--root "$ROOTFS" \
sh -c "
mkdir -p /proc
mkdir -p /sys
mkdir -p /dev
mount -t sysfs /sys /sys
mount -t proc /proc /proc
mount -t devtmpfs /dev /dev
mount -t devpts /dev /dev/pts
hostname $MACHINE
su -c '$CMDLINE' $USER
"
If I took sudo away, the mounts would fail on permission error, even with --map-root-user.
It’s even expected outcome, because if such tweak would work, it would be a privilege escalation i.e., a security vulnerability.
Still wondering what is the magic dust Podman uses here :-)
Check out our own Ryan Goodfellow’s fantastic InfoQ talk on how we're innovating rack-scale computing with P4! From programmable fabrics to debugging tools, Ry shares how to turn theory into production-ready systems. https://www.infoq.com/presentations/tofino-2/