Firewall policy mutation guard
A deterministic Claude Code PreToolUse gate for mutating iptables, nftables, UFW, firewalld, pfctl, and Windows Firewall commands while allowing inspection operations.
Runs on
Scope
$npx @youdede/toolkit add firewall-policy-mutation-guard --target claude-code
What it does
Block direct host firewall rule, policy, chain, and activation mutations.
When it fires
- setup
- operations
How it behaves
Recognize host firewall mutation verbs and refuse policy-changing commands.
It does not add, remove, flush, enable, or disable firewall rules.
It does not determine whether a port, address, zone, or rule is trustworthy.
It does not replace host isolation or network policy enforcement.
Configuration
targets/claude-code/firewall-policy-mutation-guard.mjs
- Version
- 1.0.0
- Requires
- Shell command guard
- Licence
- RiskThis automatic gate blocks direct host firewall rule, policy, chain, and activation mutations; a false denial can interrupt legitimate work, but it does not execute the blocked action.
- Medium
- ModeHow it works: fixed rules, model instructions, or both.
- Deterministic only
- Behaviour
- Enforces, blocks on violation
- On failure
- Denies and blocks
- LatencyThe entrypoint handles one intercepted event to block direct host firewall rule, policy, chain, and activation mutations without deferred work.
- Immediate
- Data retentionWhether data remains after use and who manages its storage.
- Not retained
Often used with
All in Security