Skip to content

list_firewall_policies

List every Zone-Based Firewall policy on the controller (v2 API).

Side effects: None (read-only).

Sites on UniFi Network 9.x and newer that use the Zone-Based Firewall keep their policy here, not in the legacy rulesets that list_firewall_rules reads. A site still on legacy rulesets returns [] from this tool and its rules from list_firewall_rules; audit_open_ports reads both so you do not have to guess which model a site uses.

Returns one record per policy with _id, name, action (ALLOW/BLOCK/REJECT), enabled, predefined (controller-managed, not user-created), index, protocol, ip_version, and source / destination objects whose zone_id refers to a record from list_firewall_zones. To write zone policies use create_firewall_policy, update_firewall_policy and delete_firewall_policy, which go through the Integration API and address policies by v1 id or name.

list_firewall_policies(controller="default")
Parameter Type Required Default Description
controller string no “default” Name of the UniFi controller to target. Defaults to "default".