chore: add shared Claude Code permissions and live-infra guard hook
Live-infrastructure commands were pre-approved in a local allowlist. Deploys, cluster mutations and SSH now always prompt, and a PreToolUse hook catches the same commands when they are wrapped.
This commit is contained in:
1 parent
19bf92d6bc
commit
dac1a98029
2 files changed
+109
No files matched your search
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"permissions": {
|
||||
"defaultMode": "plan",
|
||||
"disableAutoMode": "disable",
|
||||
"allow": [
|
||||
"Bash(pulumi preview *)",
|
||||
"Bash(pulumi stack ls *)",
|
||||
"Bash(pulumi whoami *)",
|
||||
"Bash(pulumi version *)",
|
||||
"Bash(npm ci)",
|
||||
"Bash(npm install)",
|
||||
"Bash(npm run typecheck *)",
|
||||
"Bash(npx tsc *)",
|
||||
"Bash(kubectl get *)",
|
||||
"Bash(kubectl describe *)",
|
||||
"Bash(kubectl logs *)",
|
||||
"Bash(git add *)",
|
||||
"Bash(git commit *)",
|
||||
"Bash(git switch *)",
|
||||
"WebFetch(domain:www.pulumi.com)",
|
||||
"WebFetch(domain:github.com)",
|
||||
"WebFetch(domain:raw.githubusercontent.com)",
|
||||
"WebFetch(domain:kube-vip.io)",
|
||||
"WebFetch(domain:longhorn.io)",
|
||||
"WebFetch(domain:registry.terraform.io)"
|
||||
],
|
||||
"ask": [
|
||||
"Bash(pulumi up *)",
|
||||
"Bash(pulumi destroy *)",
|
||||
"Bash(pulumi refresh *)",
|
||||
"Bash(pulumi import *)",
|
||||
"Bash(pulumi state *)",
|
||||
"Bash(pulumi config set *)",
|
||||
"Bash(pulumi config rm *)",
|
||||
"Bash(pulumi stack output *)",
|
||||
"Bash(kubectl get secret*)",
|
||||
"Bash(kubectl apply *)",
|
||||
"Bash(kubectl delete *)",
|
||||
"Bash(kubectl patch *)",
|
||||
"Bash(kubectl drain *)",
|
||||
"Bash(kubectl exec *)",
|
||||
"Bash(ssh *)",
|
||||
"Bash(scp *)",
|
||||
"Bash(curl *)",
|
||||
"Bash(git push *)"
|
||||
],
|
||||
"deny": [
|
||||
"Bash(env)",
|
||||
"Bash(printenv *)",
|
||||
"Bash(pulumi stack export *)",
|
||||
"Read(**/.env)",
|
||||
"Edit(**/Pulumi.dev.yaml)"
|
||||
]
|
||||
},
|
||||
"hooks": {
|
||||
"PreToolUse": [
|
||||
{
|
||||
"matcher": "Bash",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/guard-live-infra.sh"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user