Find what references an object
find_referencesFind what references a firewall address, service, virtual IP, or interface before you change it. Returns a verdict, direct and transitive references, and safe_to_delete from the appliance.
Instructions
Find what references an address, service, or interface, before changing it.
This answers the question that precedes every firewall change, which is whether something is safe to touch.
The authority is the appliance itself. FortiOS exposes the same
reference lookup its web UI uses, which knows every table that can hold
a reference, seventy-four of them for a firewall address on 7.0.14. This
tool asks that endpoint and reports what it says in references. It
also scans policies, groups, virtual IPs, and static routes directly,
because those yield readable detail the endpoint does not, such as a
policy's name and action.
Read verdict rather than inferring from a count:
referenced, something points at itno_references, the appliance confirmed nothing doesno_references_in_checked_scopes, the authoritative lookup was unavailable and a partial scan found nothing, which is a fact about four tables rather than about the applianceobject_not_found, no address, group, service, virtual IP, or interface by this name exists, so the question is probably a typoindeterminate, something needed could not be read
safe_to_delete appears only for the first two, because a table this
tool could not read cannot support a claim that nothing references the
object. A denied read is the likely outcome for a correctly
least-privileged token, so an incomplete answer is normal rather than
exceptional, and sources_checked names what failed.
The two lists count different things, and will disagree without being
in conflict. total_references and references count reference
sites: a policy using one address as both its source and its
destination is two. The detail lists (policies, groups, vips,
routes) count objects, so the same policy appears once there, with
referenced_as naming both roles. Neither number is wrong; prefer
references when reporting what must be changed before a delete, and
the detail lists when naming the objects an operator has to open.
Containers are walked through, and the results are kept separate.
references holds what the appliance named directly and every row
carries depth: 0. transitive_references holds what was reached
through an address group, a service group, a zone, or a switch: each
row carries the depth it was found at and a via chain of the
container names that led to it. The distinction is the remedy. A direct
reference is removed from the object holding it; a transitive one is
removed by editing a container or a member list, and the policy that
stops matching is not the object you edit.
expansion reports how far the walk got. status is complete when
the chain ran out, depth_capped when it hit the ceiling with
containers still unopened, which are then named in unexpanded, and
incomplete when something along the way could not be read. Only
complete means the transitive list is the whole blast radius.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vdom | No | Virtual domain to search. Defaults to the one configured for this target. An object with the same name can exist in several vdoms, and this answer is about one of them. | |
| target | No | Which FortiGate to query. Optional when only one is configured. | |
| object_name | Yes | Exact name of the address, group, service, virtual IP, or interface. Matching is exact, not a search. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||