List firewall policies
list_policiesList firewall policies in FortiOS evaluation order, with exact-match filters on address, service, interface, and enabled status. Paging and counts included.
Instructions
List firewall policies in evaluation order, optionally filtered.
Policies come back in the order FortiOS evaluates them, and each carries
an explicit order index so that ordering survives filtering and
re-serialization. Order is the entire meaning of a ruleset, and a list
position is not something downstream is obliged to preserve.
Three counts appear and they mean different things. count is rows in
this page, total_available is rows matching your filters, and
total_policies is the size of the whole ruleset. A truncated flag
means this is one page of the matches, not all of them, which matters
more here than elsewhere: reasoning about a ruleset from an arbitrary
prefix of it produces confident wrong answers about what traffic is
allowed.
The filters match names exactly and do not expand indirection. A policy
referencing a group that contains your address will not match address,
and a policy referencing a zone that contains your interface will not
match interface. If filtered_out shows a filter removed everything,
that is the cue: the object is probably reached through a group or a
zone, and find_references answers "what touches this object" properly,
walking those containers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vdom | No | Virtual domain to read. Defaults to the one configured for this target. The `vdom` field in the response names the one actually read. | |
| limit | No | Maximum policies to return. Defaults to 200, capped at 1000. | |
| offset | No | Index to start from, for paging through a large ruleset. | |
| target | No | Which FortiGate to query. Optional when only one is configured. | |
| address | No | Keep only policies naming this address object or group directly, on either side. | |
| service | No | Keep only policies naming this service object directly. | |
| interface | No | Keep only policies naming this interface directly as a source or destination interface. | |
| enabled_only | No | Drop policies whose status is disabled. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||