Overview
sandboxec relies on Linux’s Landlock LSM (Linux Security Module). Different features require different Landlock ABI versions, which map to specific kernel versions.Capability Table
The following table shows which features require which Landlock ABI and kernel versions:| Capability | Landlock ABI | Typical Minimum Kernel |
|---|---|---|
| Filesystem restrictions | v1+ | 5.13+ |
| TCP bind/connect restrictions | v4+ | 6.7+ |
Scoped restrictions (--restrict-scoped) | v6+ | Newer kernels only |
The kernel version is “typical” because distributions may backport Landlock features to older kernels. Check your actual Landlock ABI support using the methods below.
Feature Requirements
- Filesystem (ABI v1+)
- Network (ABI v4+)
- Scoped IPC (ABI v6+)
Available since: Linux 5.13 (2021)Controls:
- Read access to files and directories
- Write access (create, modify, delete)
- Execute access (run binaries)
Supported on most modern distributions (Ubuntu 22.04+, Debian 12+, RHEL 9+, etc.)
Checking Kernel Support
Method 1: Check Kernel Version
Method 2: Test with sandboxec
Run a simple command and observe the behavior:Expected Errors on Unsupported Kernels
Expected Errors on Unsupported Kernels
If your kernel doesn’t support a feature, you’ll see errors like:Use
--best-effort to continue with supported features only.Best-Effort Mode
The--best-effort flag allows sandboxec to gracefully degrade when the kernel lacks support for certain features.
How It Works
Apply supported features only
- Filesystem rules are applied on ABI v1+ kernels
- Network rules are applied on ABI v4+ kernels
- Scoped restrictions are applied on ABI v6+ kernels
- Unsupported features are silently skipped
Example Usage
- On Linux 6.8+: Both filesystem and network restrictions apply
- On Linux 5.15: Only filesystem restrictions apply (network rules skipped)
- On Linux 5.10: No restrictions apply (command runs normally)
When to Use Best-Effort
Good Use Cases
- Cross-platform scripts that run on various kernel versions
- Development environments where strict enforcement isn’t critical
- Gradual rollout of sandboxing policies
Avoid for
- Production security boundaries
- Compliance-required isolation
- Multi-tenant environments
Forcing a Specific ABI Version
You can force sandboxec to use a specific Landlock ABI version:- When to Use
- Risks
- Testing behavior on systems with newer Landlock versions
- Debugging ABI-specific issues
- Ensuring consistent behavior across different kernel versions
ABI Version Reference
| ABI Version | Introduced Features |
|---|---|
| v1 | Filesystem read/write/execute restrictions |
| v2 | Additional filesystem controls (refer, truncate) |
| v3 | Extended filesystem metadata restrictions |
| v4 | TCP bind and connect restrictions |
| v5 | Additional network protocol controls |
| v6 | Scoped IPC and signal restrictions |
Use
--abi 0 (default) to automatically detect and use the highest available ABI version on your kernel.Distribution-Specific Notes
Ubuntu
Ubuntu
- Ubuntu 24.04+: Full support (kernel 6.8+)
- Ubuntu 22.04 LTS: Filesystem only (kernel 5.15)
- Ubuntu 20.04 LTS: Filesystem only (kernel 5.4, requires backports)
Debian
Debian
- Debian 13+ (Trixie): Full support
- Debian 12 (Bookworm): Filesystem only (kernel 6.1)
- Debian 11 (Bullseye): Filesystem only (kernel 5.10)
RHEL / CentOS / Rocky / Alma
RHEL / CentOS / Rocky / Alma
- RHEL 9+: Filesystem support (kernel 5.14+)
- RHEL 8: May require custom kernel or backports
Arch Linux
Arch Linux
- Rolling release: Full support (typically latest stable kernel)
- Landlock enabled by default
Fedora
Fedora
- Fedora 38+: Full support (kernel 6.2+)
- Fedora 36-37: Filesystem only
Troubleshooting
Error: “Landlock not supported”
Your kernel either:- Is too old (< 5.13)
- Was compiled without Landlock support
- Has Landlock disabled at boot
- Upgrade to a modern kernel (5.13+ for basic support, 6.7+ for network support)
- Check if Landlock is enabled:
cat /sys/kernel/security/lsmshould includelandlock - If
landlockis missing, your kernel was not compiled with Landlock or needs a boot parameter
Error: “network restrictions require ABI v4+”
Your kernel supports filesystem restrictions but not network restrictions. Solutions:- Remove network rules:
--net c:443 - Use
--best-effortto skip network rules - Upgrade to kernel 6.7+
Error: “scoped restrictions require ABI v6+”
The--restrict-scoped flag requires very new kernels.
Solution:
- Remove
--restrict-scoped(most users don’t need it) - Upgrade to the latest stable kernel
- Use
--best-effortto skip this feature
Recommendations
Development
Use
--best-effort for flexibility across different developer machines.sandboxec.yaml
Production
Enforce minimum kernel versions and avoid Fail fast if kernel doesn’t meet requirements.
--best-effort for security-critical workloads.sandboxec.yaml
For CI/CD pipelines, document the minimum kernel version in your README and pin runner images to distributions with sufficient Landlock support.