fix: P0 security-щит permissions + Bash exec-gap + анти-дрейф мёртвых ссылок
C1 (P0): убран ведущий слэш в permissions.deny — Read(/{{homeDir}}/...) рендерился
в Read(//Users/...) (double-slash), glob НЕ матчил → SSH/secrets/gh-creds читаемы
у каждого юзера. + hard Write/Edit-deny на ssh/secrets/*.pem/*.key/*.ovpn/mcp.json.
dry-validate ловит double-slash навсегда.
C2 (P0): hooks/bash-guard.sh + matcher Bash — закрыт exec-gap (security-guard ловил
только Write|Edit, Bash проходил мимо). Блок: запись в секрет-пути через
redirect/tee/cp, force-push в main/master, чтение секретов в shell-вывод.
smoke: 7 функц-тестов.
C3 (P1/P2): мёртвые ссылки в каноне — kb-classify→kb-pipeline (structure.md §9 +
organize), sgai validate→generic web-каскад (user-template). smoke-гард: lockstep-
скиллы из §9 ∃ на диске + нет kb-classify-дрейфа.
Источник: рой-аудит (57 находок) + майнинг vault. shellcheck 0 · dry-validate OK · SMOKE OK.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
46defae697
commit
855f222300
@@ -2,14 +2,14 @@
|
||||
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
||||
"permissions": {
|
||||
"deny": [
|
||||
"Read(/{{ .chezmoi.homeDir }}/.claude/secrets/**)",
|
||||
"Read(/{{ .chezmoi.homeDir }}/.claude/server.env)",
|
||||
"Read(/{{ .chezmoi.homeDir }}/.claude/session-env/**)",
|
||||
"Read(/{{ .chezmoi.homeDir }}/.ssh/**)",
|
||||
"Read(/{{ .chezmoi.homeDir }}/.secrets/**)",
|
||||
"Read(/{{ .chezmoi.homeDir }}/.config/gh/**)",
|
||||
"Read(/{{ .chezmoi.homeDir }}/.git-credentials)",
|
||||
"Read(/{{ .chezmoi.homeDir }}/.claude/mcp.json)",
|
||||
"Read({{ .chezmoi.homeDir }}/.claude/secrets/**)",
|
||||
"Read({{ .chezmoi.homeDir }}/.claude/server.env)",
|
||||
"Read({{ .chezmoi.homeDir }}/.claude/session-env/**)",
|
||||
"Read({{ .chezmoi.homeDir }}/.ssh/**)",
|
||||
"Read({{ .chezmoi.homeDir }}/.secrets/**)",
|
||||
"Read({{ .chezmoi.homeDir }}/.config/gh/**)",
|
||||
"Read({{ .chezmoi.homeDir }}/.git-credentials)",
|
||||
"Read({{ .chezmoi.homeDir }}/.claude/mcp.json)",
|
||||
"Read(**/.env)",
|
||||
"Read(**/.env.*)",
|
||||
"Read(**/*secret*)",
|
||||
@@ -21,7 +21,23 @@
|
||||
"Edit(**/.env)",
|
||||
"Write(**/.env)",
|
||||
"Edit(**/*secret*)",
|
||||
"Write(**/*secret*)"
|
||||
"Write(**/*secret*)",
|
||||
"Write({{ .chezmoi.homeDir }}/.ssh/**)",
|
||||
"Edit({{ .chezmoi.homeDir }}/.ssh/**)",
|
||||
"Write({{ .chezmoi.homeDir }}/.secrets/**)",
|
||||
"Edit({{ .chezmoi.homeDir }}/.secrets/**)",
|
||||
"Write({{ .chezmoi.homeDir }}/.git-credentials)",
|
||||
"Edit({{ .chezmoi.homeDir }}/.git-credentials)",
|
||||
"Write({{ .chezmoi.homeDir }}/.claude/mcp.json)",
|
||||
"Edit({{ .chezmoi.homeDir }}/.claude/mcp.json)",
|
||||
"Write(**/*.pem)",
|
||||
"Edit(**/*.pem)",
|
||||
"Write(**/*.key)",
|
||||
"Edit(**/*.key)",
|
||||
"Write(**/*.ovpn)",
|
||||
"Edit(**/*.ovpn)",
|
||||
"Write(**/*credential*)",
|
||||
"Edit(**/*credential*)"
|
||||
]
|
||||
},
|
||||
"hooks": {
|
||||
@@ -35,6 +51,16 @@
|
||||
"timeout": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": "Bash",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "bash \"{{ .chezmoi.homeDir }}/.claude/hooks/bash-guard.sh\"",
|
||||
"timeout": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"SessionStart": [
|
||||
|
||||
Reference in New Issue
Block a user