forked from bchanot/claude
chore(contract): extract-guard gate rulings
This commit is contained in:
1 parent
42e37cbe85
commit
83de325e78
1 file changed
+2
@@ -17,6 +17,8 @@ Pass B `[gated 2026-11-04]` (user: recommended options): deny, not ask (the user
|
||||
|
||||
Design gate `[gated 2026-11-04]` (after the plan challenge: r1 FATAL ×3, r2 FATAL(9)/FATAL(7)/CONCERNS(2); user: "Hook simple + soft_deny", vaas-cli "les deux formes"): one POSIX-awk scanner that re-tokenizes every quoted, `$(…)`, backtick and heredoc text (no carrier list) and runs a detector from every watched tool word; remote commands follow the local rules (relative or absent destination passes); plus an `autoMode.soft_deny` line in settings.json for the forms no static parser sees; `vaas-cli ssh <vm> -- <cmd>` and `vaas-cli ssh <vm> '<cmd>'` both covered; accepted false positive: a text containing a complete extraction command into a system dir. Ruling: matcher `Bash|Monitor` (push-guard precedent, BDR-112), FILE SCOPE gains templates/settings/SETTINGS.md and CHANGELOG.md (doc-sync).
|
||||
|
||||
Gate rulings `[gated 2026-11-05]` (controller, after GATE 1 ECARTS(2) and GATE 2 PASS with 4 MEDIUM): the test suite's `# shellcheck disable=SC2016` is authorized (the single-quoted forms are the commands under test; same line in guard-bash.test.sh and seven other suites); a quoted script inherits the caller's cd directory (a `bash -c` script runs in the caller's cwd), so `cd / && ssh vm "tar xf a"` is a stated false positive; a `( … )` subshell restores the directory at its end; glob and brace destinations (`*`, `?`, `[`, `{a,b}`) are unresolvable (refused); cpio copy-pass (`-p`) counts as an extraction; commands over 256 KiB that name a watched tool are refused as too large to check.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. A PreToolUse Bash hook refuses, before it runs, a command that extracts a package or archive into `/` or a system directory: `dpkg -x` / `dpkg-deb -x` (and their long forms) with such a destination; `tar` extracting with `-C` / `--directory` to one, or after a `cd` to one in the same command; `unzip -d` to one; including when the command sits inside `ssh … '<cmd>'`, `vaas-cli ssh … '<cmd>'` or `bash -c '<cmd>'`. The refusal names the rule and the safe path (list first, extract into a work dir, or let the user run it).
|
||||
2. The same tools with a non-system destination (a relative path, `/tmp/x`, a `mktemp -d` path, the project dir) and listing forms (`dpkg -c`, `tar tf`, `unzip -l`) pass untouched; any other command passes silently.
|
||||
|
||||
Reference in new issue
Block a user