Update Claude Code permissions - #31
Conversation
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 performs an automated synchronization of the Claude Code configuration file. It updates the allowed and denied Bash command patterns to ensure the repository adheres to current security best practices defined in the central dev-ai-playbooks, effectively hardening the environment against accidental 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 updates the Claude settings to allow certain git push commands while adding specific deny rules for force pushes and recursive file removals. The review feedback identifies a critical security vulnerability where git push could be exploited for command injection via the --exec or --receive-pack flags, and suggests expanding the rm deny list to cover additional destructive command combinations.
| "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.
BLOCKER: Allowing git push* without restricting --exec and --receive-pack flags introduces a critical security vulnerability.
An agent can execute arbitrary local bash commands by running git push with the --exec or --receive-pack option pointing to a local repository path (e.g., git push --exec="id" .). Since git push* is in the allow list, this command would be executed automatically without user prompting.
Please add explicit deny rules for --exec and --receive-pack to prevent this command-injection vector.
"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*)",
"Bash(git push* --exec*)",
"Bash(git push* --receive-pack*)"References
- Section 2 (Security): Parameterized queries used, all user input validated/escaped before use, no hardcoded secrets. (link)
| "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 rm deny list does not cover several common recursive/force delete combinations, such as using --force with -r/-R or --recursive. This allows Claude to potentially prompt for or execute destructive commands like rm -r --force or rm --force -r.
Additionally, please note that simple glob matching is sensitive to whitespace; extra spaces (e.g., rm -rf) can bypass these rules.
Let's expand the deny list to cover these additional --force combinations.
"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*)",
"Bash(rm -r --force*)",
"Bash(rm -R --force*)",
"Bash(rm --force -r*)",
"Bash(rm --force -R*)",
"Bash(rm --force --recursive*)",
"Bash(rm --recursive --force*)"References
- Section 4 (Code Quality): Naming is clear, self-documenting, and follows project conventions. (link)
0b25f38 to
277a16a
Compare
277a16a to
4a24dc1
Compare
Synced from dev-ai-playbooks. Source checksum: 8cd91c129334
4a24dc1 to
e81bdbc
Compare
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.