From unifi-network
Audits UniFi firewall policies for conflicts, redundancies, security gaps, and best practices. Runs Python script for scored JSON/human reports with MCP fix recommendations. Use for rule reviews or network policy optimization.
npx claudepluginhub sirkirby/unifi-mcp --plugin unifi-networkThis skill uses the workspace's default tool permissions.
You are auditing the firewall configuration on a UniFi network. Your goal is to identify conflicts, redundancies, security gaps, and deviations from best practices — then score results and track improvement over time.
Manages UniFi firewall policies using natural language to create, modify, review rules, content filters, and traffic policies. Applies templates for IoT isolation, guest lockdown, and time-based controls.
Audits firewall rulesets from FortiGate, PAN-OS, Cisco ASA/IOS, Azure NSG, AWS SG, iptables using 17 vendor-agnostic detectors. Static analysis produces evidence with byte-offsets and citations to NIST CSF 2.0, PCI DSS v4.0.1, ISO 27001, CIS v8.1, HIPAA.
Assesses Zero Trust Firewall effectiveness using Zscaler Z-Insights analytics: allow/block ratios, location-based activity, network services, and rule hit counts. For security teams generating firewall reports.
Share bugs, ideas, or general feedback.
You are auditing the firewall configuration on a UniFi network. Your goal is to identify conflicts, redundancies, security gaps, and deviations from best practices — then score results and track improvement over time.
This skill requires the unifi-network MCP server. Use unifi_tool_index to verify available tools before proceeding.
Before running an audit, confirm the MCP server is reachable and configured:
UNIFI_NETWORK_HOST is set in the environment. If it is not set or empty, direct the user to the /setup skill before continuing.unifi_tool_index to verify the server responds and tools are available.UNIFI_MCP_HTTP_ENABLED and UNIFI_NETWORK_MCP_URL.Run the audit script for a complete, scored report:
python plugins/unifi-network/skills/firewall-auditor/scripts/run-audit.py --format json
The script connects to the MCP server (auto-detected from UNIFI_NETWORK_MCP_URL or http://localhost:3000), gathers firewall data in parallel, evaluates all 16 benchmarks, scores results, saves history, and prints a JSON report.
Interpreting the output:
The JSON report has this top-level structure:
{
"success": true,
"timestamp": "<ISO-8601>",
"overall_score": 73,
"overall_status": "needs_attention",
"summary": { "total_policies": 12, "enabled": 10, "disabled": 2, "networks": 5, "devices": 8 },
"categories": {
"segmentation": { "score": 14, "max": 25, "findings": [...] },
"egress_control": { "score": 23, "max": 25, "findings": [...] },
"rule_hygiene": { "score": 15, "max": 25, "findings": [...] },
"topology": { "score": 21, "max": 25, "findings": [...] }
},
"critical_findings": [...],
"recommendations": ["[SEG-01] No rule blocking IoT VLAN traffic... — use unifi_create_simple_firewall_policy."],
"trend": { "previous_score": 68, "change": "+5" }
}
Read overall_score and overall_status first, then walk through critical_findings before the per-category detail. Findings include a benchmark_id, severity, message, and — when applicable — a fix block with the exact MCP tool and parameters to resolve it.
For a human-readable summary instead of JSON:
python plugins/unifi-network/skills/firewall-auditor/scripts/run-audit.py --format human
references/scoring-rubric.md)| Score | Rating | Meaning |
|---|---|---|
| 80–100 | Healthy | Follows best practices with minor gaps |
| 60–79 | Needs Attention | Notable gaps; address on a planned schedule |
| 0–59 | Critical | Significant exposure requiring immediate remediation |
Each of the four categories (Segmentation, Egress Control, Rule Hygiene, Topology) contributes up to 25 points. Deductions are applied per finding instance:
The category floor is 0 — a total segmentation failure does not obscure good hygiene scores.
references/security-benchmarks.md)| ID | Category | What it checks | Default severity |
|---|---|---|---|
| SEG-01 | Segmentation | IoT VLAN blocked from private networks | critical |
| SEG-02 | Segmentation | Guest VLAN restricted to internet only | critical |
| SEG-03 | Segmentation | Management VLAN only reachable from admin sources | critical |
| SEG-04 | Segmentation | Every VLAN pair has an explicit policy | warning |
| EGR-01 | Egress Control | IoT and Guest VLANs have outbound (WAN_OUT) filtering | warning |
| EGR-02 | Egress Control | DNS forced through approved resolvers | warning |
| EGR-03 | Egress Control | Threat intelligence IP block groups defined and applied | informational |
| HYG-01 | Rule Hygiene | No disabled rules duplicating enabled ones | warning |
| HYG-02 | Rule Hygiene | No conflicting rules for identical traffic | critical |
| HYG-03 | Rule Hygiene | All rule references resolve to valid objects | warning |
| HYG-04 | Rule Hygiene | Rules have descriptive names | warning |
| HYG-05 | Rule Hygiene | No broad accept rules shadowing specific drop rules | warning |
| TOP-01 | Topology | No adopted devices offline | critical |
| TOP-02 | Topology | All devices have current firmware | warning |
| TOP-03 | Topology | Switch uplinks carry consistent VLAN configurations | warning |
| TOP-04 | Topology | No orphaned port profiles | informational |
Consult references/security-benchmarks.md for the full check definition, the MCP tools each benchmark uses, and the exact remediation command for each ID.
Each finding in the report includes a fix block when an automated remedy is available:
{
"benchmark_id": "SEG-01",
"severity": "critical",
"message": "No rule blocking IoT VLAN traffic to private networks.",
"fix": {
"tool": "unifi_create_simple_firewall_policy",
"params": { "name": "Block IoT to Private", "ruleset": "LAN_IN", "action": "drop", ... }
}
}
For each finding:
fix.tool and fix.params from the report so the user knows exactly what will change.Never call mutating tools directly from within this skill. The auditor reads; the firewall-manager writes.
Priority order for acting: address critical findings first (SEG-01, SEG-02, SEG-03, HYG-02, TOP-01), then warnings, then informational items.
The script automatically records every audit result in audit-history.json (stored in .claude/unifi-skills/ by default, or the path in UNIFI_SKILLS_STATE_DIR). Up to 50 entries are retained.
The trend field in each report shows the score change since the previous run:
"trend": { "previous_score": 68, "change": "+5" }
To compare audits over time, read the history file directly:
cat .claude/unifi-skills/audit-history.json
Each entry contains a timestamp and overall_score. Share this with the user to show improvement (or regression) after applying fixes. A healthy cadence is one audit per week or after any firewall change.
Use this procedure when the run-audit.py script is unavailable or the MCP server is not accessible via HTTP.
Call via unifi_batch:
unifi_list_firewall_policies — all policiesunifi_list_firewall_zones — zone definitionsunifi_list_networks — all networks/VLANsunifi_list_firewall_groups — Firewall groups (address/port) referenced by rulesunifi_get_dpi_stats — DPI data (shows what traffic is actually flowing)For each policy, extract and analyze:
Conflicts:
Redundancies:
Security gaps:
Unused rules:
Present findings in this format:
## Firewall Audit Report
**Total Policies:** [count] ([enabled] enabled, [disabled] disabled)
**Zones:** [list]
**Networks:** [count]
### Critical Issues
[Issues that create security vulnerabilities]
### Warnings
[Redundancies, conflicts, or best practice violations]
### Recommendations
1. [Specific, actionable recommendation with which tool to use]
2. [...]
### Policy Summary Table
| # | Name | Action | Source | Destination | Status | Notes |
|---|------|--------|--------|-------------|--------|-------|
run-audit.py --format json is faster, deterministic, and tracks history automatically. The manual procedure is a fallback only.references/security-benchmarks.md has the authoritative definition for every check ID (SEG-, EGR-, HYG-, TOP-). When a finding is unclear, look up the benchmark there.references/scoring-rubric.md explains exactly how deductions are calculated. Show users their score in context: a 73/100 is "Needs Attention", not a failing grade.fix block), then hand off to the firewall-manager skill for execution.