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:
is there a corresponding CLI command for either variant?
is there a corresponding API call for either variant?
(I'm NOT seeking workarounds - merely answer(s) to above.)
Thanks!
Nominating a forum post submits a request to create a new Knowledge Article based on the forum post topic. Please ensure your nomination includes a solution within the reply.
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.
PS.
Also, I found one more thing about API, but didn't try it before.
/api/v2/monitor/system/global-search
Created on 05-19-2024 11:00 PM Edited on 05-19-2024 11:06 PM
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.
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.
Hi ozkanaltas!
> Unfortunately, there is no different solution for CLI.
that may or may not be true. My experience is that there's a hidden cryptic or surreptitious CLI equivalent for all GUI functions.
It'd be great if a Fortinet-er provides a definitive answer.
Thanks!
Hi @Fern-X,
Why not? the grep command will find the exact match so you cannot enter 10.0.0.2 but 10.0.0 should work. Below is an example. I don't think there is another way.
Atlantis-kvm60 # show firewall policy | grep 192.168.10 -f
config firewall policy
edit 10
set name "sslvpn"
set uuid 94a8f498-b64d-51ee-9b3b-2eaa3b5051c9
set srcintf "ssl.root"
set dstintf "port4"
set action accept
set srcaddr "SSLVPN_TUNNEL_ADDR1"
set dstaddr "192.168.10.0/24" <---
set schedule "always"
set service "ALL"
set logtraffic all
set groups "Guest-group"
next
end
Regards,
Bump! Fortinet-er for a definitive answer?
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1733 | |
1106 | |
752 | |
447 | |
240 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.