FortiManager
FortiManager supports network operations use cases for centralized management, best practices compliance, and workflow automation to provide better protection against breaches.
farhanahmed
Staff
Staff
Article Id 298262
Description

 

This article explains how to enable FortiAnalyzer Logging on FortiGate via FortiManager.

 

Scope

 

FotiManager, FortiGate, FortiAnalyzer.

 

Solution

 

There are multiple ways to achieve this:

 

  1. Device database GUI.
  2. Device database CLI Configurations.
  3. System Template. <- Multiple FortiGates.
  4. CLI Template.  <- Multiple FortiGates.
  5. CLI Script. <- Multiple FortiGates.

 

  • Check the FortiGate first. In this case, it does not have 'logging' enabled to FortiAnalyzer:

 

get log fortianalyzer setting

 

1.png

 

  1. Device database GUI:
  • Go under Device Manager -> Device & Groups -> Managed FortiGate, andselect FortiGate -> Log & Report -> Log Settings (If Log & Report is not visible, enable it using the 'Feature Visibility' Option). There is no option to set the serial number of the FortiAnalyzer here.

 

2.png

 

  • Use the 'Install Wizard' and push the changes to the FortiGate. Repeat the process for all FortiGates.


3.png

 

  • Select Next.

 

4.png

 

  • Select 'Install Preview' to see if FortiManager is pushing the correct config to the FortiGate.

 

5.png

 

  • The config is correct, select Close.

 

6.png

 

  • Select Install.

 

7.png

 

 

  • The install is successful:

 

8.png

 

  • On the FortiGate, go to Security Fabric -> Fabric Connectors -> FortiAnalyzer Logging:

 

9.png

 

  • A window will appear to verify the serial number of the FortiAnalyzer:

 

10.png

 

  • The Connector is now UP:

 

11.png

 

 

Note:

In the FortiGate GUI under FortiAnalyzer Status, the "Log queued" and "Failed logs" status indicate the following:


Untitled design (1).png

 

 

 

Log queued: This represents the number of logs currently waiting to be sent from the FortiGate to the connected FortiAnalyzer. Logs may be queued due to network delays, FortiAnalyzer being temporarily unavailable, or heavy log traffic.

Failed logs: This shows the number of logs that failed to be sent to FortiAnalyzer. Failures are typically due to connectivity issues, FortiAnalyzer being offline, or the queue buffer on the FortiGate being full.

 

  • On FortiAnalzyer ('root' ADOM) Device Manager the, FortiGates now appear as unauthorized devices:

12.png

 

 

  • Select the FortiGate and select Authorize:

 

13.png

 

  • Select the ADOM the device should be authorized to and assign names for the devices, select OK.

 

14.png

 

  • Devices are successfully authorized, select Close:

 

15.png

 

  • The FortiGate will now show as UP in FortiAnalyzer and send the logs:

 

16.png

 

  1. Device Database CLI Configurations
  • Go under Device Manager -> Devices & Groups -> Managed FortiGates, select the FortiGate -> CLI Configurations.
  • Search for 'log', select 'fortianalyzer' -> Setting
  • Set the serial of FortiAnalyzer and the IP address under server.
  • Toggle the status button to enable.
  •  Select Apply.
  • Use the Install Wizard to push config: Install device settings only.
  • The FortiGate will show up in FortiAnalyzer as unauthorized, which then can be authorized to any ADOM.

 

17.png

 

  1. System Template(can be assigned to multiple devices)
  • Go under Device Manager -> Provisioning Templates -> System Templates, select 'Create New', and select Blank Template or default template:

18.png

 

19.png

  • Scroll down and toggle the Log Settings button to enable and enable 'Send Logs to FortiAnalyzer/FortiManager'

 

20.png

 

  • From 'Send to' select the appropriate option and select OK to save. 

This FortiManager: Select this option if the current FortiManager has the FortiAnalyzer Features enabled and can receive logs. Refer to this article for FortiAnalyzer Features in FortiManager: Technical Tip: How to enable FortiAnalyzer features in FortiManager

Specify IP Address: Set the IP address of the external FortiAnalyzer.

Managed FortiAnalyzer: Select this option if FortiManager is managing a FortiAnalyzer. A drop-down will appear to select the managed FortiAnalyzer.

 

21.png

 

Note:

The 'Specify Serial Number' option is not available in System Templates in FortiManager v 7.4, nor in older versions.

 

  • Select the newly created template and select 'Assign to Device/Group':

 

22.png

 

  • Select the FortiGate(s) and select the right arrow in the middle:

 

23.png

 

  • Select OK:

 

24.png

 

  • A message appears confirming the template has been assigned:

 

25.png

 

  • Go under Device & Groups > Managed FortiGate > The ForiGate status is now showing as modified and under the column 'Provisioning Templates' the system template is now showing:

 

26.png

 

 

  1. CLI Templates(can be assigned to multiple devices)
  • Go under Device Manager -> Provisioning Templates -> CLI -> Create New -> CLI Template:

27.png

 

  • Create the below script in the Script Details, select OK to save:

 

config log fortianalyzer setting

    set status enable

    set server "<FAZ IP address>"

    set serial "<FAZ Serial Number>"

    set reliable enable

    set upload-option realtime

end


28.png

 

 

  • Select the CLI Template and select 'Assign to Device/Group':

 

29.png

 

  • It lists all the FortiGates including VDOMs (e.g. global and root VDOMs for the same FortiGate-81E). Select the desired FortiGates/VDOMs and select the right arrow:

 

30.png

 

  • Select OK:

 

31.png

 

  • A message appears confirming the template has been assigned:

 

32.png

 

  • Go under Device & Groups -> Managed FortiGate. The ForiGate status is now showing as modified and under the column 'Provisioning Templates' the CLI template is now showing:

 

33.png

 

 

  1. CLI Script (can run on multiple devices).
  • Go to Device Manager -> Scripts -> Create New -> Script.

34.png

 

  • Create the below script, select Run script on 'Device Database' (can also select Run on 'Remote FortiGate Directly', then pushing config to FortiGate is not required):

 

config global <----- Required only if FortiGate has VDOMs enabled.

    config log fortianalyzer setting

        set status enable

        set server "<FAZ IP address>"

        set serial "<FAZ Serial Number>"

        set reliable enable

        set upload-option realtime

    end

 

35.png

 

 

  • Select Run Script:

 

36.png

 

 

  • Select the FortiGate (can select multiple) to run the script on then select the right arrow in the middle:

 

37.png

 

  • Select Run Now:

 

38.png

 

  • Select OK:

 

39.png

 

  • Script is successful:

 

41.png

 

  • To confirm the change on the Device Database, go under Device Manager -> Device & Groups -> Managed FortiGate, select the FortiGate -> CLI Configurations -> Search for 'log', select 'fortianalyzer' -> Setting.

 

42.png

 

 

Related articles: