Unifi Networks
Query UniFi Network sites via the official integration API — VLANs, firewall zones/policies, connected clients, and WiFi SSIDs, all mapped together — with firewall-summary and zone-matrix reports. Local (per-console key) or cloud (unifi.ui.com key, multi-console fan-out) mode. Also fetches UDM OS/app update status via the management-plane websocket (scanUpdates). Vendored from @dmc/unifi-networks (MIT, Dan McClain) with fixes: optional policy name, and correct PRESET protocol rendering.
Install & run:
swamp extension pull @shrug/unifi-networks
swamp model create @shrug/unifi-networks my-unifi
--global-arg mode=local --global-arg host=192.0.2.1
--global-arg 'apiKey=${{ vault.get("unifi", "integration-key") }}'
swamp model method run my-unifi scan
swamp model method run my-unifi scanFirewall # renders both reports
See README.md for the full method list, scanUpdates setup, and reading results back via the data model.
Global Arguments
| Argument | Type | Description |
|---|---|---|
| mode | enum | Connection mode. Determines which API key you must create: |
| apiKey | string | UniFi API key matching the chosen mode |
| host? | string | Console hostname or IP — required when mode='local' (e.g. 192.0.2.1) |
| consoleId? | string | Cloud console ID to target. When mode='cloud' and omitted, all consoles |
| verifyTls | boolean | Verify the console's TLS certificate in local mode. Set false for the |
| username? | string | UniFi OS local admin username — required for scanUpdates. |
| password? | string | UniFi OS local admin password — required for scanUpdates. |
| Argument | Type | Description |
|---|---|---|
| siteId | string | Site ID containing the policy |
| policyId | string | Firewall policy ID to delete |
| consoleId? | string | Console to target when the key sees more than one |
Resources
Zone inventory and a detailed firewall policy table (flow, action,
Source→destination firewall posture between zones (from catch-all
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned