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
This commit is contained in:
cflmy committed 2026-11-20 15:01:49 +08:00
1 parent 9b001a33a5
commit b6fc18233d
22 files changed
+1886 -132

No files matched your search

+10 -1
View File
@@ -1,6 +1,6 @@
# ADR-0019: Strict-mode availability gate
Status: **Accepted**
Status: **Accepted; Linux availability superseded by ADR-0021**
Date: 2026-11-20
Relates to: ADR-0004 (strict mode refuses without isolation), blueprint §9
@@ -18,6 +18,15 @@ rules only; it does not by itself satisfy the network/process/resource and
child-tree requirements in `docs/CORE_STABILIZATION_AND_ECOSYSTEM_GATE.md`
§13.
## Superseding note (2026-11-20)
The fail-closed principle and the per-platform, test-gated availability rule in
this ADR remain in force. A concrete Linux adapter has since passed the
security matrix in a disposable Ubuntu VM and is specified by **ADR-0021**:
strict becomes `Available` only when the Bubblewrap probe succeeds at runtime.
This ADR remains authoritative for every other platform and for the rule that
availability must never be assumed.
## Decision
### 1. Strict stays unavailable until the gate passes