Skip to main content
bksol92
Staff
Staff
November 26, 2024

Troubleshooting tip: Troubleshooting REST API access error

  • November 26, 2024
  • 0 replies
  • 2174 views
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

 

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!