fix(sandbox): support Podman escape hatches - #1106
Conversation
Greptile SummaryThe PR adds two validated, mutually exclusive Podman sandbox escape hatches while preserving secure defaults.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported unconditional service-hardening regression and unmounted-socket environment injection have both been addressed.
|
| Filename | Overview |
|---|---|
| crates/tools/src/sandbox/docker.rs | Couples host-socket mounting and environment setup, validates socket availability, labels Podman mode and socket identity, and recreates incompatible running sandboxes. |
| crates/config/src/validate/semantic.rs | Enforces Podman-only, mutually exclusive escape-hatch configuration and emits explicit security diagnostics. |
| deploy/moltis.service | Restores secure systemd defaults and directs rootless Podman deployments to the dedicated override. |
| deploy/moltis-podman.conf | Selectively permits rootless Podman re-exec and provides writable home and runtime locations. |
| deploy/moltis-podman-api.service | Adds an optional Podman API service using the same runtime socket location configured for Moltis. |
| crates/tools/src/sandbox/tests/core.rs | Covers privileged mode, socket validation, socket identity transitions, recreation behavior, and improved diagnostics. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
C[Sandbox configuration] --> V{Podman escape hatch}
V -->|Neither| H[Hardened Podman sandbox]
V -->|allow_host_podman| S[Validate live host socket]
S --> I[Compute socket identity]
I --> M{Running sandbox label matches?}
M -->|Yes| R[Reuse sandbox]
M -->|No| X[Recreate with socket mount and API environment]
V -->|allow_nested_podman| P[Recreate privileged nested sandbox]
Reviews (3): Last reviewed commit: "test(config): cover host Podman platform..." | Re-trigger Greptile
Merging this PR will improve performance by 22.62%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | session_history_path[user@host:session:42] |
8.1 µs | 6.6 µs | +22.62% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing simplistic-partner (5781f63) with main (f32b67a)
Footnotes
-
9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
# Conflicts: # docs/src/service.md
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
withered-breeze-e956 | 24aa9bf | Commit Preview URL Branch Preview URL |
Aug 18 2026, 01:47 AM |
Keep the default systemd unit hardened and provide explicit rootless Podman overrides and API service setup instead of weakening every deployment. Tie socket mounts and environment together, validate a live Linux Unix socket, recreate containers when escape-hatch mode or socket identity changes, and reject unsafe configuration combinations.
|
@greptile review |
Compile the non-Linux diagnostic only on supported test targets and add Linux acceptance coverage so the patch coverage report no longer counts unreachable lines.
|
@greptile review |
# Conflicts: # crates/config/src/validate/tests/tools.rs # crates/tools/src/sandbox/docker.rs
Summary
Validation
Completed
cargo test -p moltis-tools sandbox::tests::core::test_podmancargo test -p moltis-config podman_escape_hatchjust build-web-assetsjust release-preflight./scripts/local-validate.sh 1106Remaining
allow_host_podmanandallow_nested_podman.Manual QA
deploy/moltis.servicewithdeploy/moltis-podman.conf; verify rootlesspodman run --rm alpine echo hellounder the service.allow_host_podman, enabledeploy/moltis-podman-api.service, verify socket passthrough, then restart the API service and confirm the sandbox is recreated.allow_nested_podman, verify nested Podman runs only in a privileged sandbox and switching the flag off recreates a hardened sandbox.Fixes #1095