Skip to content

feat(sandbox): add privileged VM sandbox mode with BPF LSM seal - #5932

Draft
drew wants to merge 1 commit into
mainfrom
feat/5925-privileged-vm-sandboxes/drew
Draft

drew wants to merge 1 commit into
mainfrom
feat/5925-privileged-vm-sandboxes/drew

Conversation

@drew

@drew drew commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Add --privileged (--priv) mode so workloads can run as real guest UID 0 inside VM-backed sandboxes (unblocking workloads that need root-owned image files, nested namespaces, or mounts, such as SWE-bench images, Chromium, and bwrap). Instead of relying on a capability-free non-root UID, Landlock, and a broad child seccomp deny list, privileged mode requires a VM boundary (openshell-driver-vm or Kubernetes with an explicitly configured VM RuntimeClass such as Kata) and moves enforcement into a boot-once, frozen BPF LSM seal plus namespace isolation, while keeping egress mediated through seccomp_notify.

Related Issue

Closes #5925

Changes

  • API, SDK, and CLI: add privileged to SandboxSpec / DriverSandboxSpec, supports_privileged to GetCapabilitiesResponse, and --privileged / --priv to openshell sandbox create. Drivers that do not advertise support fail closed.
  • Guest kernel and VM runtime: harden openshell.kconfig for root workloads (CONFIG_BPF_LSM=y, BTF, early lockdown, modules/kexec//dev/mem/uprobes disabled), stage bootstrap secrets into /run/openshell outside the workload overlay, and launch openshell-sandbox --privileged.
  • openshell-sandbox privileged runtime and BPF LSM: isolate workloads in dedicated PID, mount, cgroup, and loopback-only network namespaces via workload-hold + pivot_root; load and freeze (BPF_MAP_FREEZE) 18 BPF LSM hooks protecting the shim, bpf(), AF_VSOCK, init_net, runtime mounts, freezer cgroup, and live-reloadable filesystem_policy (read_only/read_write and shadow-mount prevention); drop kernel-escape caps while keeping workload caps; mediate egress with networking-only seccomp_notify + ADDFD and a minimal child seccomp filter blocking io_uring_* and nested NEW_LISTENER.
  • Confirmation audit: add PrivilegedGuestProfile and PrivilegedSandboxAuditEvidence verified by the supervisor on Confirm.
  • Kubernetes + Kata support: add opt-in privileged_runtime_class_name (OPENSHELL_K8S_PRIVILEGED_RUNTIME_CLASS_NAME / Helm server.privilegedRuntimeClassName), container-root (--workload-root /) submount handling, and kernel-TGID/parent-TGID handling so Kata Pod teardown works cleanly.
  • E2E tests: add e2e/rust/tests/vm_privileged.rs covering Chromium, bwrap, BPF LSM seal/policy enforcement, network mediation, and hard-Landlock rejection.

Release Notes

VM-backed sandboxes (local VM driver and Kubernetes with an explicitly configured VM RuntimeClass such as Kata) can now be launched with openshell sandbox create --privileged (--priv) to run workloads as guest UID 0 under a boot-once BPF LSM seal and seccomp_notify egress mediation.

Testing

  • Pre-commit checks pass (cargo fmt, cargo clippy --workspace --all-targets, buf lint, helm lint, helm:docs:check, license check)
  • Unit tests updated across affected crates
  • E2E tests added and run (e2e-vm.sh including vm_privileged, plus live Kata Containers on k3s verification)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Nov 24, 2026
@drew
drew marked this pull request as draft November 24, 2026 06:33
@github-actions

Copy link
Copy Markdown

Compatibility review (advisory)

New or updated breaking changes; see the full report for all findings.

1. rust-sdk — No explicit risk acceptance found

Previously complete Rust structs now require privileged on curated/raw SandboxSpec and raw DriverSandboxSpec, or supports_privileged on raw GetCapabilitiesResponse.

  • Impact: Downstream clients, mocks, and driver implementations using complete literals or exhaustive patterns fail to compile with E0063/E0027, even without requesting privileged mode.
  • Action: Preserve the exported struct shapes for v0.1.10, or defer these fields to a minor release with notice and migration guidance covering false, ..Default::default(), and rest patterns.
  • PR: feat(sandbox): add privileged VM sandbox mode with BPF LSM seal #5932
Review details
  • Execution: complete
  • Candidate: PR #5932 (ef6c8882123617fa96cf63bbeec0c2d19eaa719b)
  • Baseline: 152c59d3178039e3fbb4a5595f9fff7216a6be92 (152c59d3178039e3fbb4a5595f9fff7216a6be92)
  • Reviewed: rust-sdk, python-sdk, api-behavior, cli, configuration, policy, helm, state

Advisory review; publication gates are unchanged.

Branch check run

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:accepted A maintainer decided OpenShell should pursue this issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support privileged (true guest root) workloads in openshell-sandbox for VM sandboxes

1 participant