Skip to content

harden secret-file denies: cover sed/awk/grep and other read vectors - #2

Merged
awcjack merged 1 commit into
masterfrom
fix/secret-file-read-vector-denies
Jul 2, 2026
Merged

harden secret-file denies: cover sed/awk/grep and other read vectors#2
awcjack merged 1 commit into
masterfrom
fix/secret-file-read-vector-denies

Conversation

@awcjack

@awcjack awcjack commented Jul 2, 2026

Copy link
Copy Markdown
Owner

The Claude Code permission denylist only enumerated cat/head/tail/base64 for secret files (.env, values*, secret, keys, ssh/aws/kube/gcloud, ...), so content readers like sed, awk, grep, pagers, editors, and copy commands bypassed it entirely — e.g. sed -E '...' .env read a secret straight through the sandbox.

Generate the deny matrix (exfil command x secret glob) from two lists so coverage stays exhaustive and self-maintaining instead of hand-enumerating each command per file variant. Deny beats allow, so these override the blanket Bash(cat *)/Bash(grep ) allows. Concrete .env variants only (never a blanket .env.), so .env.example/.sample/.template stay readable.

The Claude Code permission denylist only enumerated cat/head/tail/base64
for secret files (.env, values*, *secret*, keys, ssh/aws/kube/gcloud, ...),
so content readers like `sed`, `awk`, `grep`, pagers, editors, and copy
commands bypassed it entirely — e.g. `sed -E '...' .env` read a secret
straight through the sandbox.

Generate the deny matrix (exfil command x secret glob) from two lists so
coverage stays exhaustive and self-maintaining instead of hand-enumerating
each command per file variant. Deny beats allow, so these override the
blanket Bash(cat *)/Bash(grep *) allows. Concrete .env variants only (never
a blanket .env.*), so .env.example/.sample/.template stay readable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@awcjack
awcjack merged commit c531e2f into master Jul 2, 2026
1 check passed
@awcjack
awcjack deleted the fix/secret-file-read-vector-denies branch July 2, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant