firewall-audit
Skill1 starsChanged 15 days agoMITView on GitHub
Audit of the firewall policies of a UniFi site, for shadowed, too broad, duplicate, and unused policies and objects. Use when the user asks to review, audit, check, or clean up the UniFi firewall, or asks if the firewall is secure.
In this repository4 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- client-troubleshootingSkill
- firewall-changeSkill
- health-checkSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Call get_firewall_overview.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
UniFi firewall audit
Examine each user-defined firewall policy of a UniFi site against the checks below, and report the findings. Each finding names the policy, the zone pair, the check, and the evidence. All tools in this skill are read-only.
How the firewall works
- A policy belongs to one zone pair: a source zone and a destination zone.
get_firewall_overviewshows the policies of each zone pair in the order of evaluation (index). - The console applies the first enabled policy that matches the traffic. A later policy does not apply to traffic that an earlier policy matched.
origintells who made a policy.USER_DEFINEDpolicies are from the user.SYSTEM_DEFINEDpolicies are the defaults of the console.DERIVEDpolicies are the return traffic of an ALLOW policy withallowReturnTraffic. Audit only theUSER_DEFINEDpolicies, and use the other policies as context.- A traffic filter with
matchOppositematches all values except the given values. - A policy without a source filter or without a destination filter matches all traffic of that side of the zone pair.
Steps
- Call
get_firewall_overview. If the tool asks for asite_id, calllist_sites, and ask the user which site to audit. - Call
find_unused_objects. - For each zone pair, examine each
USER_DEFINEDpolicy in order against each check in the table below. - Write the report.
The audit is complete when each user-defined policy of each zone pair was examined against each check. Count the policies, and give the count in the report.
Checks
| Check | Finding | Severity |
| Shadowed | An earlier enabled policy in the same zone pair matches all the traffic of a later policy. The later policy never applies. If the two policies have different actions, the severity is high. | High or medium |
| Too broad | An ALLOW policy has no source filter and no destination filter, and matches all protocols. If the source zone is the internet (External), the severity is high. | High or medium |
| Open port from the internet | An ALLOW policy from the External zone to an internal zone allows a port. Name the port and the destination. | Medium |
| Duplicate | Two policies in the same zone pair have the same filters, the same protocol scope, and the same action. | Low |
| No logging | A BLOCK or REJECT policy has loggingEnabled false. Blocked traffic is then not visible in the logs. | Low |
| Disabled | A user-defined policy is disabled. It can be a remainder of an old change. | Low |
| Unused object | find_unused_objects shows a traffic matching list that no policy uses, or a custom zone without networks. | Low |
A schedule, a connection state filter, or an IPsec filter makes a policy match less traffic. Consider these filters before you report a policy as shadowed or too broad. If you are not sure that a policy is shadowed, report it as "possibly shadowed", and give the reason.
Report
- One sentence: the number of zone pairs and user-defined policies, and the number of findings by severity.
- A table with the columns Severity, Check, Policy (name and ID), Zone pair, Evidence, and Suggested fix. Put the most severe finding first.
- The zone pairs without findings, in one line.
To fix a finding, use the firewall-change skill. Each fix changes the network, so the user must approve it first.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

