feat(delivery): add the guard hook (ADR-0032 layer 2)
Ship one pre-tool-use hook in the delivery package. It denies the Never tier on every runtime and asks before Odd jobs on Claude Code and Copilot CLI (denying them on Codex and unknown runtimes): - guard.py: stdlib-only Python; tokenises the shell line, unwraps bash -c / env / sudo / eval / xargs / find -exec / rtk / uv run and friends, checks file-tool paths for secret material, and uses read-verb allowlists for kubectl, helm, flux and tofu - hooks.json: no matcher, onFailure: block, 10s timeout - tests/test-delivery-guard-hook.sh: 281 cases incl. bypass attempts and per-runtime output shape - root apm.yml: executables.allow delivery#0.1.0 - check-executables-allow-sync now covers every plugin shipping hooks/bin - ADR-0032 amended: Copilot ask kept as an accepted risk, file tools and allowlists recorded Refs #190 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
This commit is contained in:
1 parent
6edd66432c
commit
a6ff1c14d4
11 files changed
+2244
-110
No files matched your search
@@ -57,3 +57,8 @@ build/
|
||||
# to the file, not the directory: the sibling .claude-plugin/marketplace.json is
|
||||
# compiled output that IS committed and must stay tracked.
|
||||
/.claude-plugin/plugin.json
|
||||
|
||||
# Python bytecode. plugins/delivery ships a Python hook (.apm/hooks/guard.py);
|
||||
# apm copies the whole hooks directory, so a stray cache would deploy with it.
|
||||
__pycache__/
|
||||
*.pyc
|
||||
Reference in new issue
Block a user