Skip to main content
Fern-X
New Member
May 20, 2024
Question

CLI for locating Firewall Policies or Address/Groups whose members match a searched address

  • May 20, 2024
  • 6 replies
  • 3425 views

Hello!

Fortigate GUI's 'Policy & Objects > Firewall Policy' (attachment) and 'Policy & Objects > Addresses' has a "Search" field to locate a firewall policy or Address Group containing within it (either explicitly, or implicitly, within address range or subnet) the specified address.

Two questions:

  1. is there a corresponding CLI command for either variant?

  2. is there a corresponding API call for either variant?

(I'm NOT seeking workarounds - merely answer(s) to above.)

Thanks!

x.png

6 replies

ozkanaltas
Valued Contributor III
May 20, 2024

Hello @Fern-X 

 

You can use grep command for that question. For example;

 

show firewall policy | grep -f Object_NAME

 

This command searches your query in the policy configuration.

 

For API, you can use the filtering feature. 

 

blob_chrome-extension___fdpohaocaechififmbbbbbknoalclacl_e502d0e9-706a-488d-b1cf-540bfa73b609.png

 

PS.

Also, I found one more thing about API, but didn't try it before.

 

/api/v2/monitor/system/global-search

 

image.png

Fern-X
Fern-XAuthor
New Member
May 20, 2024

Hi ozkanaltas !

> show firewall policy | grep -f Object_NAME

no, this shows Tables matching specified regexp pattern, not an IP addresses within within a Address or Address Group instance. Look at my screenshot - yours won't find what I've shown.

ozkanaltas
Valued Contributor III
May 20, 2024

Hello @Fern-X ,

 

It's my fault that I didn't pay attention to the image strings on the screen. Unfortunately, there is no different solution for CLI.

Fern-X
Fern-XAuthor
New Member
May 20, 2024

Bump! Fortinet-er for a definitive answer?

Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.
Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT