Logo di Unifi Firewall

Unifi Firewall

Community
t3chnaztea
unifi-firewall

Use when working on UniFi firewall rules, zones, or network segmentation: "my firewall rules are empty", "rest/firewallrule returns nothing", "isolate my IoT devices", "block cameras from the internet", "create a firewall zone", "VLAN isolation", "zone-based firewall", "my IoT devices lost DNS after I segmented them", or auditing what a zone actually permits. Covers the zone-based firewall model, where policies live, the block-by-default trap on new zones, and lockout safety. Assumes unifi-connect. Not for assigning devices to VLANs or switch ports (unifi-clients), Wi-Fi and SSID-to-network mapping (unifi-wifi).

Panoramica

Pubblicato dat3chnaztea
Repositoryunifi-skills
Nome della skillunifi-firewall
Stelle
44
Fork
1
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da t3chnaztea su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Unifi Firewall in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/t3chnaztea/unifi-skills/tree/main/skills/unifi-firewall
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/t3chnaztea/unifi-skills.git /tmp/unifi-skills
mkdir -p .claude/skills
cp -r /tmp/unifi-skills/skills/unifi-firewall .claude/skills/unifi-firewall
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Unifi Firewall in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Unifi Firewall non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Unifi Firewall non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

UniFi Firewall

Modern UniFi Network replaced the old LAN-IN / LAN-LOCAL / WAN-IN rule groups with a zone-based firewall. Every network belongs to a zone, and policies govern traffic between zone pairs rather than between interfaces. This is a better model and a worse migration, because the old API endpoint still exists and still answers.

Why your firewall rules look empty

bash
udm raw GET /proxy/network/api/s/default/rest/firewallrule
# []

An empty array. The endpoint is alive, authenticated, and lying by omission: on a zone-based controller your rules are not there. They are here:

bash
udm policies    # GET /proxy/network/v2/api/site/default/firewall-policies
udm zones       # GET /proxy/network/v2/api/site/default/firewall/zone

An agent that reads rest/firewallrule, sees [], and concludes the network is unfirewalled will confidently propose rebuilding rules that already exist. If a gateway reports zero firewall rules and it is clearly not wide open, you are on the wrong endpoint.

The zone endpoint is singular. /firewall/zone works, /firewall/zones 404s. There is no reason for this; just remember it.

The trap: new zones default to BLOCK against Internal

The single most expensive thing to learn the hard way.

Creating a new custom zone auto-generates default policies, and the Internal↔zone pair defaults to BLOCK in both directions. External and Gateway pairs default to allow, and custom→External allows, so the new zone reaches the internet fine. What it loses, instantly and completely, is the trusted LAN: DNS resolvers, the media server, the home-automation hub, the NAS.

The failure mode is nasty because it is partial. Devices still have internet. They still associate, still pull DHCP, still look healthy in the controller. They just cannot resolve names against your internal resolver, so everything degrades ten seconds later in a way that reads like a DNS outage.

Stage the allow policies before you create the zone. Have the payloads written and ready to POST, create the zone, then immediately POST the allows. Do not create a zone at the end of a session, and do not create one for a segment containing anything you or your household will notice going down.

If you are already in the hole: the zone exists, its devices are cut off, and the fix is POSTing allow policies to firewall-policies for the Internal→zone and zone→Internal directions.

A worked segmentation: IoT and cameras

The common goal. Two custom zones, each with a deliberately small hole punched back into the trusted network.

IoT zone. Cheap devices with vendor cloud dependencies. They need the internet, they need the gateway, and they need a very short list of internal services:

  • zone → External: allow (they phone home, that is what they do)
  • zone → Gateway: allow (DHCP, DNS to the gateway itself)
  • zone → Internal: allow only specific destination+port pairs
    • DNS, tcp/udp 53, to your internal resolvers
    • your media server's port, to that host only
    • your automation hub's UI port and MQTT broker port, to that host only
  • zone → Internal: block everything else, explicitly, as the last rule
  • Internal → zone: allow all (you want to reach them; they should not reach you)

Camera zone. Cameras are the segment most worth isolating and the easiest, because a locally-recorded camera needs almost nothing:

  • zone → Gateway: allow
  • zone → External: block, with an explicit named policy. This is the whole point. A camera that cannot reach the internet cannot be recruited into a botnet, cannot phone a vendor cloud, and still records perfectly to a local NVR.
  • Internal → zone: allow all

Order matters within a zone pair, same as any firewall. Put the narrow allows above the broad block.

If you also run per-device rules (a smart TV blocked from ad domains, a bedtime schedule on a game console) note that rules written against the Internal zone do not follow a device when you move it to a custom zone. Mirror them into the new zone, or the schedule you set up last year quietly stops applying.

Writing policies

bash
# List, and find the one you mean
udm policies --json | python3 -c '
import json,sys
for p in json.load(sys.stdin):
    print(p["_id"], p.get("action"), p.get("name"))'

# Create
udm policies create '{...}'

# Update: GET the policy, modify, PUT the whole object back
udm policies update <POLICY_ID> '{...full object...}'

udm policies delete <POLICY_ID>

Build a payload by reading an existing policy of the same shape and editing it. The schema is undocumented and version-specific; a policy the controller wrote itself is the most reliable template you will find.

v2 PUTs may return HTTP 201 instead of 200. That is success. Do not retry.

Verify from a fresh GET, never from the PUT response. Re-read the policy list and confirm the rule is present, enabled, in the position you expect, and in the zone pair you expect.

Lockout safety

You are configuring the device your management traffic flows through. A firewall mistake here does not throw an error, it removes your ability to fix the error.

  • Know your out-of-band path before the first write. Physical console access, a directly-cabled port, the recovery procedure for your model. If your answer is "I'd just SSH in", check that SSH is even enabled: on many UniFi OS gateways port 22 is closed by default.
  • Never apply a default-deny to the zone holding your workstation. Obvious until the moment you are auditing zones and one of them is quietly the one you are sitting in.
  • Write allow policies before restrictive ones, not after. The window between "zone created" and "allows applied" is a live outage.
  • One change, one verification. Batching six policy writes and then testing means the failure is in one of six places, and you may not be able to reach the controller to find out which.
  • Snapshot first. udm policies --json > policies-$(date +%F).json costs nothing and is the difference between a rollback and an archaeology project.
  • Prefer scheduled maintenance windows for segmentation work, for the same reason you would on any other network: the recovery involves walking to the device.

Domande frequenti

Cosa fa la skill IA Unifi Firewall?

Use when working on UniFi firewall rules, zones, or network segmentation: "my firewall rules are empty", "rest/firewallrule returns nothing", "isolate my IoT devices", "block cameras from the internet", "create a firewall zone", "VLAN isolation", "zone-based firewall", "my IoT devices lost DNS after I segmented them", or auditing what a zone actually permits. Covers the zone-based firewall model, where policies live, the block-by-default trap on new zones, and lockout safety. Assumes unifi-connect. Not for assigning devices to VLANs or switch ports (unifi-clients), Wi-Fi and SSID-to-network...

Perché usare Unifi Firewall su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Unifi Firewall è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Unifi Firewall in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/t3chnaztea/unifi-skills/tree/main/skills/unifi-firewall. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Unifi Firewall?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Unifi Firewall?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Unifi Firewall: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Unifi Firewall è gratuita?

Sì. È pubblicata su GitHub da t3chnaztea con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇