Which firmware version are you using? You can edit firewall policy on the GUI > Policy & Object. Make sure it is listed as "By Sequence". You can use "Shift" key to select all the policies and under the Log column, click the pencil and change to All and click Apply. See screenshot below
There is no CLI command to change them all at the same time. Is "0 - 4294967294" a policy name?
We are running 7.0.12 on the fortigate and v7.0.8 for the fortimanager
But the suggested solution does not work.
When I select all rules on the fortigate I can only change the log settings to ALL or Disabled or Utm. The option for log Generate logs when session start is not possible to select it is even not available on the gui on the fortigate. Only by cli
Using the fortimanager I have 3 log option to change when selecting al the rules. “Disable, Log security events, Log all Sessions”.
There is a bit of a mismatch in naming between Fortigat gui and fortimanger ☹.
On the fortimanager I can change only enable Generate logs when session start one rule at a time.
I can think of two ways of achieving that: 1- You can create a script editing one firewall policy at time, something like the below. You can create a bash or python script that generates it automatically (for only the firewall policy IDs present in your config):
config firewall policy edit 1 set logtraffic-start enable next edit 2 set logtraffic-start enable next ... ... edit N set logtraffic-start enable next end
2- Alternatively you can export a backup copy of the config from GUI, edit it with a text editor and restore it through the GUI menu. Restoring the config will cause a restart of the firewall.
Please bear in mind that enabling that setting on all firewall policies will generate a double amount of logs for each session hitting those firewall policies.
--- If you have found a useful article or a solution, please like and accept it to make it easily accessible to others.
According to my knowledge there is no CLI command to change all firewall policy rules at the same time. However, you can use the GUI to select all of the rules and then enable logtraffic-start on all of them.
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.