Software sandboxing: The basics (2025)
summary
Effective software sandboxing should be implemented as discretionary privilege dropping, where a process intentionally restricts its own access to system resources. This is best achieved by adopting an actor-model architecture based on compartmentalization into separate processes that communicate via message passing. By treating file descriptors as unforgeable capabilities, developers can create secure, granular access control policies that prevent compromised components from accessing the rest of the system.
key points
- The actor model provides a powerful framework for sandboxing by treating each process as an actor that shares no memory and communicates solely through UNIX domain sockets, allowing for flexible and resource-restricted topologies.
- FreeBSD's Capsicum is presented as the gold standard for sandboxing because it allows a process to enter a capability mode via cap_enter(), which completely disables ambient authority and forces all system interactions to occur through existing file descriptors.
- On Linux, sandboxing is more complex due to thes a lack of a single 'capability mode' and the combination of seccomp and Landlock is required to filter syscalls and filesystem access, though tools like Kafel can help manage these complex policies.
who should read it
Software engineers and security researchers interested in implementing robust process-level isolation and privilege restriction in their applications.
discussion positive
consensus
Commenters generally agree that traditional Unix security models, based on identity and ambient authority, are fundamentally flawed for modern sandboxing needs. They favor capability-based security or strict whitelisting over the process-level restrictions often attempted in Linux. While various tools like seccomp and Docker Sandboxes are used, there is a strong preference for the simplicity and effectiveness of OpenBSD's pledge and unveil mechanisms.
top insight
The discussion reveals a critical distinction between academic sandboxing projects, like Capsicum on FreeBSD, and practical, widely adopted implementations like OpenBSD's pledge and unveil. While Capsicum is theoretically superior, OpenBSD's approach is integrated into major browsers by default, proving that ease of use and developer adoption are more important for real-world security than theoretical perfection.
Generated by an LLM from the article and thread. Check the sources before relying on it.