[Paper Review] Apptainer Without Setuid
This paper presents a rootless, setuid-free architecture for Apptainer (formerly Singularity), enabling unprivileged users to create, run, and securely encrypt containers using user namespaces, FUSE, and modern Linux filesystems like squashfs and overlay. The key contribution is native support for unprivileged container operations—including nested execution and full SIF encryption—without requiring privileged access or system administrator configuration of /etc/subuid and /etc/subgid, while maintaining performance comparable to privileged methods.
Apptainer (formerly known as Singularity) since its beginning implemented many of its container features with the assistance of a setuid-root program. It still supports that mode, but as of version 1.1.0 it no longer uses setuid by default. This is feasible because it now can mount squashfs filesystems, ext3 filesystems, and overlay filesystems using unprivileged user namespaces and FUSE. It also now enables unprivileged users to build containers, even without requiring system administrators to configure /etc/subuid and /etc/subgid unlike other "rootless" container systems. As a result, all the unprivileged functions can be used nested inside of another container, even if the container runtime prevents any elevated privileges. As of version 1.2.0 Apptainer also supports completely unprivileged encryption of Singularity Image Format (SIF) container files. Performance with a particularly challenging HEP benchmark using the FUSE-based mounts both with and without encryption is essentially identical to the previous methods that required elevated privileges to use the Linux kernel-based counterparts.
Motivation & Objective
- To eliminate reliance on setuid-root programs in Apptainer for improved security and usability.
- To enable unprivileged users to build and run containers without requiring system-level configuration of /etc/subuid and /etc/subgid.
- To support full container encryption and nested container execution in unprivileged environments.
- To maintain high performance comparable to privileged container execution methods.
Proposed method
- Leveraging unprivileged user namespaces to isolate container processes without elevated privileges.
- Using FUSE-based mounts for squashfs, ext3, and overlay filesystems to enable container image access without kernel-level privileges.
- Implementing user-space filesystem operations that replace kernel-based setuid mechanisms for mounting container images.
- Integrating unprivileged SIF container file encryption using user-space cryptography, eliminating need for privileged key management.
- Designing a runtime architecture that supports nested container execution even when the host container runtime blocks elevated privileges.
- Enabling container build processes entirely within unprivileged user namespaces, removing dependency on system-level user ID mapping configuration.
Experimental results
Research questions
- RQ1Can Apptainer eliminate the need for setuid-root programs while preserving full container functionality and security?
- RQ2Can unprivileged users build and run containers without system administrator configuration of /etc/subuid and /etc/subgid?
- RQ3Can FUSE-based filesystem mounting achieve performance comparable to kernel-based, privileged mounting?
- RQ4Can full container encryption be implemented in an unprivileged, user-space manner without requiring elevated privileges?
- RQ5Can container operations be securely nested within other containers when no elevated privileges are allowed?
Key findings
- Apptainer 1.2.0 fully supports unprivileged container creation, execution, and encryption without requiring setuid or system-level user ID mapping configuration.
- The performance of FUSE-based mounting, with and without encryption, is essentially identical to previous privileged kernel-based methods on a challenging HEP benchmark.
- Unprivileged users can now build and run containers without any intervention from system administrators, even in restricted environments.
- Nested container execution is fully supported in unprivileged mode, enabling secure, isolated execution chains.
- Full encryption of Singularity Image Format (SIF) files is now natively supported in unprivileged mode, with no reliance on privileged components.
- The transition to a setuid-free architecture does not compromise security or functionality, while significantly improving usability and attack surface reduction.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.