FortiAnalyzer
FortiAnalyzer can receive logs and Windows host events directly from endpoints connected to EMS, and you can use FortiAnalyzer to analyze the logs and run reports.
bksol92
Staff
Staff
Article Id 359693
Description This article describes how to troubleshoot errors encountered when polling FortiAnalyzer's API as a REST API user.
Scope FortiAnalyzer.
Solution

FortiAnalyzer allows the generation of API keys to be used by API users for polling purposes:

 

api-key.PNG

 

REST API users also require the configuration of trusted hosts to make API access more secure:

 

trusted-hosts.PNG

 

API users will need to make sure to poll FortiAnalyzer's API from a trusted subnet. If the subnet polled from is not trusted, it will display the following error:

 

{'result': [{'status': {'code': -11, 'message': 'No permission for the resource'}}], 'id': 5}

 

The following debug can be run to see what IP the incoming API request is coming from:

 

dia de app auth 8

dia de en

auth api user: from=10.111.37.32 origin=(null)
no api admin matched

 

To resolve this, the correct subnet needs to be included:

 

subnet-correct.PNG

 

Once this is done, debug will show the API request being authorized:

 

auth api user: from=10.111.37.32 origin=(null)
matched api admin: api-admin