Implement sandlock-oci: OCI-compliant runtime for namespace-less sandboxing#31
Implement sandlock-oci: OCI-compliant runtime for namespace-less sandboxing#31sachin2605 wants to merge 1 commit intomultikernel:mainfrom
Conversation
… using containered and kind k8s cluster
Code reviewOverviewAdds a new Blocking issues1. The translated OCI policy is discarded — sandbox does nothing
let _builder = spec::spec_to_policy(&spec, &bundle)?;Then at let policy = sandlock_core::Policy::builder()
.build()
.unwrap_or_else(|_| {
sandlock_core::Policy::builder().build().expect("minimal policy")
});An empty policy is built and handed to the supervisor. As a result, none of the spec-derived rules are applied at runtime:
The In addition, CI doesn't catch this because no test creates a container, runs a process, and asserts that the rootfs/env/limits took effect. The shell scripts that would catch it aren't part of CI. 2. Integration tests duplicate production code rather than test it
let spec = sandlock_oci_test_helpers::load_spec(dir.path())…
let builder = sandlock_oci_test_helpers::spec_to_policy(&spec, dir.path()).unwrap();So Two ways forward: (a) add Significant issues3. CI silently skips the bin's
|
Pull Request: Implement OCI-compliant Runtime for Sandlock Sandbox
Title
Implement sandlock-oci: OCI-compliant runtime for namespace-less sandboxing
Description
This PR introduces
sandlock-oci, a low-level OCI runtime shim that enables thesandlocksandbox to be used as a drop-in replacement forruncincontainerd,CRI-O, and Kubernetes environments.Unlike traditional runtimes,
sandlock-ocifocuses on a "no-container" approach, providing isolation via Landlock and Seccomp-Notify without relying on Linux namespaces (PID, Mount, Network, etc.). This makes it ideal for high-performance, lightweight sandboxing of host-level processes.Key Features
config.json(filesystem rules, resource limits, environment) tosandlock::Policy.create,start,state,kill,delete, andlist.SIGSTOP/SIGCONT)./run/sandlock-ocifor integration with container engines.RuntimeClassintegration, enablingruntimeClassName: sandlockin Pod specs.Implementation Details
crates/sandlock-oci: The new OCI shim crate.src/spec.rs: OCI specification parsing and policy mapping logic.src/supervisor.rs: Background daemon logic for process orchestration.src/state.rs: JSON-based state persistence for OCI compliance.Testing
tests/integration.rscovering the full OCI lifecycle.tests/containerd/test_containerd.sh) validating manual OCI lifecycle and containerd registration.kindcluster test script (tests/kubernetes/test_kind.sh) for validatingRuntimeClassand Pod deployments.Checklist
sandlock-corefor Landlock/Seccomp confinement/run/sandlock-ocicontainerdandkind cluster