Repository navigation
Update Claude Code permissions - #38
Conversation
Synced from dev-ai-playbooks. Source checksum: 8cd91c129334
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request updates the Claude Code configuration to align with the repository's standard security policies. It ensures that the automated permission settings are consistent with the central playbook, specifically refining the allowed and denied bash commands to prevent potentially destructive operations. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request modifies the Claude settings to allow git push commands while attempting to restrict force pushes and recursive deletions through specific pattern matching. However, the review feedback points out that these deny patterns are fragile and easily bypassed by altering flag combinations. To address these security concerns, it is recommended to use more robust wildcard patterns for blocking recursive deletions and to rely on remote branch protection rules as the primary defense against force pushes.
| "Bash(rm -rf*)", | ||
| "Bash(rm -fr*)", | ||
| "Bash(rm -Rf*)", | ||
| "Bash(rm -fR*)", | ||
| "Bash(rm -r -f*)", | ||
| "Bash(rm -f -r*)", | ||
| "Bash(rm -R -f*)", | ||
| "Bash(rm -f -R*)", | ||
| "Bash(rm --recursive*)" |
There was a problem hiding this comment.
WARNING: The current list of rm deny patterns is fragile and can be easily bypassed by inserting other flags in between (e.g., rm -rvf, rm -vrf, or rm -irf). Since Claude Code permissions use simple glob matching, we can robustly block all recursive deletions using wildcard patterns that target any hyphenated option containing r or R after a space, plus --recursive.
"Bash(rm * -*r*)",
"Bash(rm * -*R*)",
"Bash(rm *--recursive*)"References
- Section 2: Security (BLOCKER if violated) - Ensure robust security controls and prevent bypasses of safety restrictions. (link)
| "Bash(git push* --force*)", | ||
| "Bash(git push* +*)", | ||
| "Bash(git push* -f*)", | ||
| "Bash(git push* -uf*)", | ||
| "Bash(git push* -vf*)", | ||
| "Bash(git push* -qf*)", | ||
| "Bash(git push* -nf*)", | ||
| "Bash(git push* -df*)", |
There was a problem hiding this comment.
WARNING: Similar to the rm patterns, the git push force-deny list is easily bypassed by combining flags in different orders (e.g., git push -af or git push -vuf). Because glob patterns cannot easily match arbitrary combined flags without causing false positives on branch names containing the letter f, these patterns should not be solely relied upon. Please ensure that branch protection rules (e.g., blocking force pushes to main/master) are enabled on the remote repository as the primary line of defense.
References
- Section 2: Security (BLOCKER if violated) - Ensure robust security controls and prevent bypasses of safety restrictions. (link)
Automated update of
.claude/settings.jsonfrom dev-ai-playbooks.This is a full overwrite of the permissions file (allow + deny lists) to keep
this repo's Claude Code permissions in sync with the canonical template. If
this repo has custom
allowentries not present in dev-ai-playbooks (e.g.phpunit,npm, or other project-specific commands), check the diff beforemerging -- they will be removed by this PR and need to be re-added by hand.
Source checksum:
8cd91c129334This PR was created automatically. It only affects what Bash commands Claude
Code can run in this repo -- no application code is changed.