Switch git permissions to deny/ask-based approach#69
Merged
Conversation
- Add deny list for destructive git operations (force push, reset --hard, clean -f, checkout ., restore .) - Add ask list for operations affecting shared state (push, merge, rebase, reset, clean, stash drop/clear, branch -D, config) - Replace 12 individual git subcommand allows with single Bash(git *) - Migrate all Bash rules from :* syntax to space * syntax Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Replace 20 individual gh subcommand rules with 7 using wildcard patterns: - Bash(gh * list *) covers all list subcommands - Bash(gh * view *) covers all view subcommands - Bash(gh search *) covers search and search repos Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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
reset --hard,clean -f/-fd,checkout .,restore .など破壊的操作を禁止push,merge,rebase,reset,clean,stash drop/clear,branch -D,configなど影響の大きい操作は毎回確認Bash(git *)で残りの git コマンドを一括許可(deny > ask > allow の評価順序を活用):*から空白*に統一しますgit push自体を ask にすることで二重防御しています🤖 Generated with Claude Code