update_firewall_policy
Replace a firewall policy by ID with a full new configuration to update traffic filtering rules on a UniFi site.
Instructions
Full-replace a firewall policy by ID.
host: console name, ID, or composite ID (MAC:numericId format). site: site name or ID.
policy: full firewall policy configuration to replace with.
policy_id: REQUIRED. The policy's id; obtain it from list_firewall_policies (its id field).
trafficFilter (optional; may appear on source and/or destination) narrows the match
beyond the zone pair. Set trafficFilter.type plus the ONE matching nested object:
IP_ADDRESS -> ipAddressFilter.items[] (IP addresses / CIDRs)
NETWORK -> networkFilter.networkIds[] (network UUIDs)
PORT -> portFilter.items[] (ports / port ranges)
MAC_ADDRESS -> macAddressFilter.macAddresses[] (client MAC addresses) The controller may also support further types (e.g. region/identity-based); list_firewall_policies only reveals the types already in use on a site, so an unlisted type is not evidence it is unsupported. PORT-FILTER PLACEMENT FOOTGUN: a portFilter under source.trafficFilter filters SOURCE ports, which for outbound flows are ephemeral (random high ports) -> the rule silently matches nothing. A destination-port rule MUST use destination.trafficFilter with type PORT, never a source portFilter. (create/update_firewall_policy log a runtime warning when a source PORT filter is combined with an any-destination ALLOW.)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| site | Yes | ||
| policy | Yes | ||
| policy_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||