You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jq -n '{"decision":"block","reason":"Blocked by firewall-edit-blocker: editing init-firewall.sh is not allowed. The network firewall is a security boundary."}'
35
+
exit 2
36
+
fi
37
+
38
+
# Block edits to sudoers files
39
+
ifecho"$FILE_PATH"| grep -qF "sudoers";then
40
+
jq -n '{"decision":"block","reason":"Blocked by firewall-edit-blocker: editing sudoers files is not allowed. Sudo permissions are a security boundary."}'
-**Secrets handling**: Never commit API keys, tokens, passwords, or private keys -- use environment variables or `.env` files (which are gitignored)
16
17
-**Unsafe operations**: Avoid `eval`, `exec`, `pickle.loads`, `subprocess(shell=True)`, and `yaml.load` without SafeLoader in production code. If required, document the justification in a code comment
17
18
-**Code review**: The code-reviewer agent checks for logic-level security issues (authorization bypass, TOCTOU, data exposure) that static pattern matching cannot catch
Copy file name to clipboardExpand all lines: docs/DECISIONS.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,3 +172,15 @@ When a decision is superseded or obsolete, delete it (git history preserves the
172
172
| GitHub API via curl (`curl -H "Authorization: ..." https://api.github.com/.../merge`) | Blocking curl to github.com is fragile and breaks legitimate web fetching. The hook already blocks commands containing `GH_TOKEN=` as a literal argument. | Use fine-grained PATs with minimal scopes. CLAUDE.md instructs Claude to use `gh` CLI, not raw API calls. Token scoping is the real control. |
173
173
| Docker not present but deny rules exist | Docker is not installed in the current template container. Deny rules exist as defense-in-depth for users who add Docker-in-Docker later. | If Docker-in-Docker is added, the deny list should be revisited (add `-v` and `--mount` volume escape patterns). |
174
174
| Whitelisted domains as exfil channels |`github.com` is whitelisted for git/gh operations. A compromised agent could theoretically exfiltrate via gist creation or issue comments. | Token scoping (no gist/issue create permission) + GH mutation deny rules in Tier 2. Tier 3 accepts this risk explicitly. |
175
+
176
+
## 2026-03-15: Devcontainer Firewall Inbound Relaxation and Tamper Protection
177
+
178
+
**Request**: Fix two firewall problems: (1) strict inbound filtering blocks legitimate dev server use cases unnecessarily, (2) Claude can tamper with the firewall via iptables commands or by editing init-firewall.sh.
179
+
180
+
**Decisions**:
181
+
- Default to permissive inbound (`FIREWALL_ALLOW_INBOUND=true`) -- the primary threat model is egress (data exfiltration), not inbound; Docker's own network stack handles inbound isolation
182
+
- Opt-in strict inbound via `FIREWALL_ALLOW_INBOUND=false` preserves the original INPUT DROP behavior for users who need it
183
+
- Three-layer tamper protection: deny rules in all tier files + settings.json (Layer A), firewall command patterns in devcontainer-policy-blocker.sh (Layer B), new firewall-edit-blocker.sh hook blocks edits to init-firewall.sh and sudoers (Layer C)
184
+
- Firewall deny rules apply at ALL tiers (not tier-gated) because the firewall is a security boundary, not a workflow convenience
185
+
-`sudo` broadly denied in tier files because the vscode user's only sudoers entry is the firewall script, and Claude should never re-run it
186
+
- firewall-edit-blocker.sh only activates when `DEVCONTAINER=true` -- no-op on bare metal where users own their own firewall
0 commit comments