chore(settings): broaden permission patterns + add credential audit script#103
Open
aaronsb wants to merge 1 commit into
Open
chore(settings): broaden permission patterns + add credential audit script#103aaronsb wants to merge 1 commit into
aaronsb wants to merge 1 commit into
Conversation
Settings: - Adds ~25 broad `Bash(cmd:*)` patterns and 7 `mcp__server__*` wildcards covering the command families sessions kept re-prompting on (curl, sudo, adr, kg, mmaid, way-embed, jira-cloud MCP, etc.). - Keeps main's hand-curated 59-entry list as the base — does not replace it with raw session accumulation. Audit script (scripts/audit-permissions.sh): - Greps settings files for credential-shaped permission entries (basic-auth user:token, Bearer tokens, GitHub/Anthropic/OpenAI/ Slack/AWS/Atlassian key prefixes, AUTH=... env captures). - Catches the failure mode where `Always allow` on a `curl -u` pins the secret into the permission string verbatim. - Exits non-zero on findings; safe to wire into a hook later. .gitignore: allowlist the new script (the file uses deny-by-default).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two changes, motivated by the realization that the previous "roll up accumulated grants" PR (#101, closed) would have undone
main's curated 59-entry pattern list with 842 hyper-specific entries — and that the same per-command auto-capture was the vector for two real Atlassian API tokens ending up in working-treesettings.json.Broader permission patterns
Bash(cmd:*)patterns:curl,sudo,tar,printf,pip/pip3,npm/npx/node,jq,adr,adr-tool,dotfiles,mmaid,kg,way-embed,way-match,attend-chat,gpg,gpgconf,base64,.claude/**.mcp__server__*wildcards:knowledge-graph,jira-cloud,chrome-devtools,claude-in-chrome,google-workspace,slack-mcp,thinking-strategies.Credential audit script (
scripts/audit-permissions.sh)Greps settings files for credential-shaped permission entries: basic-auth
user:token,Bearer …, and explicit prefixes for GitHub PATs, Anthropic/OpenAI keys, Slack tokens, AWS access keys, Atlassian API tokens, andAUTH=user:secretenv-var captures.Exits non-zero on findings — safe to wire into a pre-commit hook later if you want enforcement.
Test plan
python3 -m json.tool settings.jsonvalidates.scripts/audit-permissions.shexits 0 on this branch.scripts/audit-permissions.shexits 1 when fed a JSON file containing a syntheticcurl -u user@host:ATATT3xFf...permission.curl …,sudo …,mcp__jira-cloud__*, etc. proceed without prompts.Notes
curl -u user:tokenverbatim when you accept "Always allow"). The audit script is reactive; preventing the capture requires either upstream redaction in Claude Code or behavioral hygiene (use~/.netrc/ env vars instead of-uargs).