How Podman --userns=auto Strengthens Container Isolation

Our companion post explains why Bundar currently runs rootful Podman with --userns=auto. This one explains the mechanism itself: what a user namespace does, what auto adds on top, and where the protection ends.

The default problem: container root is host root

Without user namespaces, UID 0 inside a container maps to UID 0 on the host. Other controls still matter — Linux capabilities, seccomp, SELinux or AppArmor, mount configuration, and the container runtime all contribute to the boundary — but there is no UID translation layer between container root and host root. If host resources become reachable through a vulnerable runtime or a dangerous mount, that missing identity boundary can make the impact much worse.

User namespaces: a different UID map per container

A user namespace lets the kernel maintain a separate UID/GID mapping for a group of processes. Inside the namespace, a process can be UID 0 — install packages, bind ports, act like root for everything the container needs. Outside the namespace, the kernel translates that UID 0 to whatever unprivileged UID the mapping says, for example UID 100000. Every file access, every permission check on the host side uses the mapped identity.

That changes the host-side permission checks for operations that remain subject to the user namespace: the kernel sees the mapped UID, such as 100000, rather than host UID 0. This can materially reduce the blast radius of misconfigured mounts and classes of container or runtime compromise. It does not mean every kernel or runtime escape becomes an unprivileged-user incident; an exploit that defeats the namespace boundary itself is outside what UID mapping can contain.

What auto adds: a fresh range per container

You can build these mappings by hand with --uidmap/--gidmap flags, and people did. --userns=auto automates it: Podman picks an unused subordinate range from /etc/subuid and /etc/subgid and assigns it to the container — a different range for each container.

That per-container part matters. If every container mapped to the same subordinate UID, a breakout from one container could reach the files of another. With auto, container A's root might be host UID 100000 while container B's root is host UID 165536. They are as isolated from each other as two unprivileged users on a shared machine — which, to the kernel, is exactly what they are.

On Bundar-managed servers we provision these ranges during server setup: each workload gets its own slice carved out of the subuid/subgid space, so the isolation is in place before the first container ever starts.

What this protects against — and what it doesn't

It adds an identity boundary that can keep container root from acting as host root when the namespace mapping still applies. User namespaces complement other hardening such as dropping unnecessary capabilities, using read-only filesystems where compatible, seccomp, and SELinux or AppArmor. Those controls are separate; Bundar does not currently apply all of them universally.

It does not make the management plane unprivileged. In Bundar's current automated setup, Podman, conmon, and the setup tooling still run as root on the host — a vulnerability in the runtime is a different threat than a workload that remains constrained by its user namespace, and --userns=auto does not remove that management-plane risk.

Rootless Podman is a separate layer: it limits the management process to the invoking account's access, as Daniel J. Walsh explains. Where supported and provisioned with enough subordinate IDs, it can also be combined with --userns=auto — a pairing Walsh called “probably the most secure” — but Bundar uses rootful Podman.

One operational wrinkle worth knowing: files a container writes to a mounted volume show up on the host owned by the subordinate UID (that 100000, not root and not your SSH user). Backup scripts and host-side tooling need to account for that. It's a papercut, not a flaw — but it's the kind of thing magic-free infrastructure makes visible instead of hiding.

The one-line version

--userns=auto gives every container its own subordinate UID/GID mapping automatically. Container root no longer maps directly to host root, which adds a useful identity boundary and reduces the impact of classes of compromise — without pretending that user namespaces eliminate runtime or kernel escape risk.