Skip to content

feat(sandbox): spike Landlock non-docker sandbox PoC (MCP-34.1) - #754

Merged
Dumbris merged 1 commit into
mainfrom
spike/mcp-3232-nondocker-sandbox
Jun 24, 2026
Merged

Dumbris merged 1 commit into
mainfrom
spike/mcp-3232-nondocker-sandbox

Conversation

@Dumbris

@Dumbris Dumbris commented Jun 24, 2026

Copy link
Copy Markdown
Member

Spike: non-Docker sandbox mechanism for snap-docker Ubuntu 24.04 (MCP-34.1)

Gates [MCP-34] (Non-Docker isolation mode). Determines — before the 1.5–2w
full build commits — which unprivileged primitive actually works for stdio MCP
servers on Ubuntu 24.04 with snap-installed Docker under AppArmor.

Recommendation (resolves plan decisions D2 + D3)

  • D2 — mechanism: Landlock LSM (5.13+) for the filesystem write-allowlist
    • setrlimit for resource caps + best-effort SysProcAttr.Credential
      for uid/gid. Landlock needs no user namespace, so it is not blocked by
      kernel.apparmor_restrict_unprivileged_userns=1 — the default on Ubuntu
      23.10+/24.04 that breaks bubblewrap. userns/bwrap deprioritized (would
      trade one AppArmor block for another). Honest limit: no uid/gid separation
      without root/CAP_SETUID.
  • D3 — scanner: recommend surfaced degradation (run stdio under the sandbox
    launcher; skip the Docker scanner with a health-surfaced warning) over a native
    scanner rewrite; final call in the scanner child issue.

Full write-up: docs/development/sandbox-spike-mcp-34.md.

Minimal PoC — internal/sandbox/

  • Landlock fs allowlist via raw golang.org/x/sys/unix syscalls (no new
    dependency
    ), setrlimit, ABI best-effort down-masking, fail-closed
    cross-platform stub.
  • TestLandlockEnforcesFilesystemAllowlist re-execs a confined child that
    proves: (1) stdin→stdout JSON-RPC framing survives, (2) RW allowlist is
    read+writable, (3) a path outside the allowlist is denied.

Verification

  • go build ./... (darwin + linux amd64/arm64) ✅ · golangci-lint v2 (both
    GOOS) 0 issues ✅ · cross-platform tests pass on macOS ✅.
  • Empirical proof on the target OS: the enforcement test runs in CI on
    ubuntu-latest (= Ubuntu 24.04) via go test -race ./... (not in the skip
    list). I authored this on macOS and cannot exercise Landlock locally — the
    PR's own CI run on ubuntu-latest is the proof; it t.Skips gracefully if the
    runner lacks Landlock.
  • Not done here (host-dependent, deferred to MCP-34 Add dynamic menu updates and server management features #3/Remove unused isDatabaseOpen method from Manager struct to streamline code and improve maintainability. #4): end-to-end
    npx/uvx launch under the wrapper and the side-by-side MCPX_DOCKER_SNAP_APPARMOR
    reproduction — these belong with the launcher/spawn-branch work.

No production spawn path is modified; this is a spike (package + test + doc).

Related MCP-3232, MCP-34.

Spike gating MCP-34 (non-docker isolation mode). Proves an unprivileged,
non-Docker confinement primitive for stdio MCP servers on snap-docker
Ubuntu 24.04, where Docker fails under AppArmor (MCPX_DOCKER_SNAP_APPARMOR,
GH #71).

- internal/sandbox: Landlock LSM fs allowlist via raw x/sys/unix syscalls
  (no new dependency) + setrlimit, ABI best-effort down-masking, fail-closed
  cross-platform stub.
- Enforcement test re-execs a confined child: denies a path outside the
  allowlist, permits the RW allowlist, preserves stdin/stdout JSON-RPC
  framing. Runs in CI on ubuntu-latest (= Ubuntu 24.04).
- Recommendation doc resolves plan decisions D2 (Landlock + rlimits +
  best-effort uid/gid; userns/bwrap deprioritized) and D3 (scanner degradation).

Related MCP-3232, MCP-34
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 21bda5e
Status: ✅  Deploy successful!
Preview URL: https://3bc1b404.mcpproxy-docs.pages.dev
Branch Preview URL: https://spike-mcp-3232-nondocker-san.mcpproxy-docs.pages.dev

View logs

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 20.21277% with 75 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/sandbox/sandbox_linux.go 18.47% 73 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: spike/mcp-3232-nondocker-sandbox

Available Artifacts

  • archive-darwin-amd64 (28 MB)
  • archive-darwin-arm64 (25 MB)
  • archive-linux-amd64 (16 MB)
  • archive-linux-arm64 (14 MB)
  • archive-windows-amd64 (28 MB)
  • archive-windows-arm64 (25 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (21 MB)
  • installer-dmg-darwin-arm64 (19 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 28076531589 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@mcpproxy-gatekeeper mcpproxy-gatekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gatekeeper approval — review verdict: ACCEPT (by KimiReviewer, model-diverse fallback).

This approval is posted automatically by the MCPProxy Gatekeeper App on behalf of KimiReviewer — the model-diverse reviewer-fallback reviewer of record (verdict lives in the Paperclip review thread). Author≠approver satisfied; QA + CI gates enforced separately.

Auto-approved per Model B (MCP-1249) + reviewer-fallback (MCP-3066).

@Dumbris

Dumbris commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

Closing — Algis full-stop on CTO auto-spun roadmap work (on-hold/server items against personal-first). Not merging; parent epic parked to todo.

@Dumbris Dumbris closed this Jun 24, 2026
@Dumbris Dumbris reopened this Jun 24, 2026
@Dumbris
Dumbris merged commit fc323cf into main Jun 24, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants