Files
marqdo-cli/docs/evidence/2026-11-20-local-gate.md
T
cflmy b6fc18233d feat(sandbox): implement probe-gated Linux strict isolation (ADR-0021)
Strict mode now re-executes the CLI inside a Bubblewrap supervisor with
user/mount/PID/net/UTS/IPC namespaces, no-new-privs, all capabilities dropped,
a read-only /project, private /proc and /dev, rlimits, output capture and
wall-clock process-group cleanup. The child verifies PID 1, NoNewPrivs, empty
CapEff, an unshared uid map and loopback-only networking before project code.

- PlatformCapabilities::detect runs a real bwrap probe; no probe, no strict
- strict L1 supports pure Marqdo + Math; Foreign/ABI/worker/kernel/grants/trace
  are rejected with exit 2 before sandboxing
- forged MARQDO_STRICT_ACTIVE is rejected; missing bwrap fails closed
- add adversarial helper, 7-test escape/resource matrix, seeded security lane
  script and self-hosted security workflow
- executed G-C lane as uid 1000 in a disposable Ubuntu 26.04 VM: 7/7 PASS
  plus positive CLI and refusal matrix; evidence in docs/evidence
- ADR-0021, spec/security.md, STATUS/COMPATIBILITY/README/CHANGELOG updated;
  ADR-0019 remains for non-Linux/fail-closed rules
2026-11-20 15:01:49 +08:00

78 lines
2.8 KiB
Markdown

# Local gate evidence — 2026-11-20
Code commit tested: `2cf9ecedd590f57cd8a816d26dbe19417ddfed81`.
Workspace version: `0.1.0` (no tag). Host: Ubuntu 26.04 container,
Rust 1.100.0, x86_64.
This is **local** evidence. It is not a GitHub Actions URL and does not replace
the native Windows/macOS lanes. See `COMPATIBILITY.md` for the honest matrix.
## Commands and results
```text
cargo fmt --all -- --check PASS
cargo clippy --workspace --all-targets -- -D warnings PASS
cargo test --workspace PASS (46 test binaries)
cargo build --release --locked -p marqdo-cli PASS
```
Notable suites in the run:
```text
conformance_ast 4 tests PASS (LF canonical + CRLF byte fixture)
integration_cli 23 tests PASS
plugin_worker 4 tests PASS
marqdo-foreign provider 8 tests PASS
analysis_trace / tool_protocol PASS
package_env PASS
```
## Windows checkout reproduction
A fresh clone with `core.autocrlf=true` was made from this tree:
```text
golden_has_CR False
crlf_fixture_has_CRLF True
cargo test -p marqdo-cli --test conformance_ast -> 4 passed
```
Converting one golden to CRLF before the fix reproduced the original
"0 line(s) differ" symptom; the new diagnostic reported the first differing
byte and classified it as line endings only.
## Release candidate and clean-install smoke
The release binary was packaged with specs, examples, licenses, changelog and
compatibility matrix, then extracted into a fresh temporary directory. The
SHA-256 file verified before extraction. Executed from the extracted tree:
```text
marqdo --version marqdo 0.1.0
marqdo --help exit 0
check examples/factorial.mq.md exit 0
run examples/hello.mq.md 你好,Marqdo
call factorial 阶乘 --arg n=5 120
check multi-module --emit analysis exit 0
analysis_consumer.py exit 0 (functions=2)
run multi-module --trace-file exit 0
trace_consumer.py exit 0 (events=7)
run packages-multi-version exit 0
run python-foreign --allow-foreign 28.274333882308138
run hello --mode strict exit 1, refusal message
tool install/run/remove exit 0
```
## Environment limits observed
- The process is root inside a container with no effective capabilities
(`capsh`: `Current: =`) and `no-new-privs=1`.
- `setpriv --reuid=65534` fails (`setresuid: Operation not permitted`), so a
true non-root run could not be performed on this host.
- `unshare` (user/mount/PID/net) and `bwrap` fail with `EPERM`; cgroup2 is
mounted read-only.
- Therefore G-C could not be evaluated on that container host. It was later
executed in a disposable Ubuntu 26.04 VM; see
[`2026-11-20-strict-gc.md`](2026-11-20-strict-gc.md) and
`docs/security-gate.md`.