unifi_update_firewall_policy
Update fields of a user-defined UniFi firewall policy by merging changes; previews the result unless confirm is true and rejects system-managed policies.
Instructions
Change fields of a user-defined firewall policy. Give only what changes; source/destination merge (a null trafficFilter removes it). The tool reads the policy, merges and PUTs the whole object. Always needs confirm: true; without it the tool previews the changed fields. System-defined policies and the IPS auto-blocks are refused: UniFi manages them. A side that is a zone alone reaches every network in it, and UniFi's Internal zone holds every LAN. So a policy on a zone holding a protected network (UNIFI_MCP_PROTECTED_NETWORKS, pi-cluster by default) is confirm-level unless its filters provably exclude it: a NETWORK filter naming only other networks the console has, or IPv4 addresses, ranges or subnets (directly or through an IPv4 traffic matching list) outside the protected subnets. Addresses that overlap a protected subnet are confirm-level in any zone. Anything the guard cannot place leans to confirm: an unknown zone, list or network id, an IPv6 address, an opposite match, or a MAC, port or other filter, which counts as the whole zone.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"policy": "<policy>"
},
"name": "unifi_update_firewall_policy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Policy name | |
| site | No | Site name, id or reference; optional while the console has a single site | |
| action | No | What matched traffic gets | |
| policy | Yes | Policy id or exact name | |
| source | No | ||
| confirm | No | Must be true to carry out a guarded change; without it the tool only previews it | |
| enabled | No | Whether the policy is active | |
| schedule | No | ||
| ipVersion | No | IP versions matched | |
| description | No | Description | |
| destination | No | ||
| ipsecFilter | No | IPsec match | |
| loggingEnabled | No | Send matches to syslog | |
| protocolFilter | No | ||
| allowReturnTraffic | No | ALLOW only: also allow the return traffic (default false) | |
| connectionStateFilter | No | Connection states matched (absent: all) |