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
Executable
+1275
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"hooks": {
|
||||
"PreToolUse": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"command": "${CLAUDE_PLUGIN_ROOT}/.apm/hooks/guard.py",
|
||||
"onFailure": "block",
|
||||
"timeout": 10,
|
||||
"type": "command"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user