[论文解读] Apptainer Without Setuid
本论文提出了一种无 root 权限、无 setuid 的 Apptainer(前身为 Singularity)架构,使非特权用户能够使用用户命名空间、FUSE 和现代 Linux 文件系统(如 squashfs 和 overlay)创建、运行并安全加密容器。主要贡献在于原生支持非特权容器操作(包括嵌套执行和完整的 SIF 加密),而无需特权访问或系统管理员配置 /etc/subuid 和 /etc/subgid,同时保持与特权方法相当的性能。
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.
研究动机与目标
- 消除 Apptainer 对 setuid-root 程序的依赖,以提升安全性和可用性。
- 使非特权用户能够在不需系统级配置 /etc/subuid 和 /etc/subgid 的情况下构建和运行容器。
- 在非特权环境中支持完整的容器加密和嵌套容器执行。
- 保持与特权容器执行方法相当的高性能。
提出的方法
- 利用非特权用户命名空间隔离容器进程,而无需提升权限。
- 使用基于 FUSE 的挂载方式访问 squashfs、ext3 和 overlay 文件系统,实现在无内核级权限的情况下访问容器镜像。
- 实现用户空间文件系统操作,替代基于内核的 setuid 机制以挂载容器镜像。
- 通过用户空间加密实现非特权 SIF 容器文件的完整加密,消除对特权密钥管理的需求。
- 设计一种运行时架构,即使主机容器运行时阻止了提升权限,也能支持嵌套容器执行。
- 使容器构建过程完全在非特权用户命名空间内执行,消除对系统级用户 ID 映射配置的依赖。
实验结果
研究问题
- RQ1Apptainer 是否能在不依赖 setuid-root 程序的前提下,保持完整的容器功能和安全性?
- RQ2非特权用户是否能够在不需系统管理员配置 /etc/subuid 和 /etc/subgid 的情况下构建和运行容器?
- RQ3基于 FUSE 的文件系统挂载是否能达到与基于内核的特权挂载相当的性能?
- RQ4是否能够以非特权、用户空间的方式实现完整的容器加密,而无需提升权限?
- RQ5当不允许提升权限时,容器操作是否能够安全地嵌套在其他容器中?
主要发现
- Apptainer 1.2.0 完全支持非特权容器的创建、执行和加密,无需 setuid 或系统级用户 ID 映射配置。
- 在具有挑战性的 HEP 基准测试中,基于 FUSE 的挂载(无论是否启用加密)性能与之前基于内核的特权方法基本相同。
- 非特权用户现在无需系统管理员干预即可在受限环境中构建和运行容器。
- 非特权模式下完全支持嵌套容器执行,可实现安全、隔离的执行链。
- SIF 文件的完整加密现已原生支持于非特权模式,且完全不依赖特权组件。
- 向无 setuid 架构的迁移并未损害安全性或功能性,反而显著提升了可用性并减少了攻击面。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。