Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
AndiG
New Contributor

Generate a list of matching FortiGate policies

I like to generate a weekly report that includes any active FortiGate-Policy filtered by some keywords in their name.

I'm able to query them from $log-traffic, but obviously this gets only the policies with traffic.

Is there a table that includes the configured policies regardless of them having traffic or not?

1 Solution
funkylicious

as you already noticed, in FAZ you would have logs and info about the firewall policies that have either logging all sessions or security profiles matches.

 

you could do a diff between the policy id/name from FAZ that are being noticed there and the ones actually configured on the FGT.

in the GUI you would also enable the column Hit Count and see the ones with no match/0 hits or Last Used to see when they were last used/matched.

"jack of all trades, master of none"

View solution in original post

"jack of all trades, master of none"
3 REPLIES 3
funkylicious
SuperUser
SuperUser

show firewall policy | grep TEXT ? you could do a -A X lines to print the next X lines

"jack of all trades, master of none"
"jack of all trades, master of none"
AndiG

Hi Funkylicious

Thanks for your suggestion. Grep would kind of work, yes...

But I'm looking for an automated solution, prefferably using FortiAnalyzer and being able to use its SQL capabilities for advanced filtering. 

funkylicious

as you already noticed, in FAZ you would have logs and info about the firewall policies that have either logging all sessions or security profiles matches.

 

you could do a diff between the policy id/name from FAZ that are being noticed there and the ones actually configured on the FGT.

in the GUI you would also enable the column Hit Count and see the ones with no match/0 hits or Last Used to see when they were last used/matched.

"jack of all trades, master of none"
"jack of all trades, master of none"
Announcements
Check out our Community Chatter Blog! Click here to get involved
Labels
Top Kudoed Authors