Skip to content

list_firewall_rules

List every legacy-ruleset firewall rule on the controller.

Side effects: None (read-only).

Reads the legacy /rest/firewallrule collection (rulesets such as WAN_IN and LAN_IN). A site that has migrated to the Zone-Based Firewall (Network 9.x and newer) keeps its policy elsewhere and this returns [] even though the firewall is configured: use list_firewall_policies for those sites, or audit_open_ports, which reads both.

Returns one record per rule with _id, name, ruleset, rule_index, action, enabled, protocol, and src_*/dst_* fields.

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