H "Authorization: Bearer <KEY>" -H "accept: application/json"3.) After REST API authorization the FortiGate validates the POST datatype and format.
H "Cotent-Type: application/x-www-form-urlencoded"- Run the below command to verify the API request coming from clear pass policy manager (CPPM) is Getting authorized by Fortigate Firewall or not.
d "{'endpoint_ip' : ['10.10.10.2', '10.10.10.10', '172.16.80.203'], 'spt': 'healthy'}"
# dia debug reset.
# dia debug application httpsd -1
# dia debug cli 8
# dia debug en
[httpsd 4548 - 1597584268 info] fweb_debug_init[301] -- New POST request for "/api/v2/monitor/firewall/clearpassaddress/add" from "172.26.x.x:30957"
[httpsd 4548 - 1597584268 info] fweb_debug_init[302] -- User-Agent: "python-requests/2.24.0"
[httpsd 4548 - 1597584268 info] fweb_debug_init[304] -- Handler "api_monitor_v2-handler" assigned to request
[httpsd 4548 - 1597584268 warning] api_access_check_for_api_key[964] -- API Key request authorized for ccpm from 172.26.x.x. <-----The REST API key accepted by the FortiGate.
[httpsd 4548 - 1597584268 info] api_store_parameter[239] -- add API parameter 'endpoint_ip' (type=array) <----- Post Data Endpoint.
[httpsd 4548 - 1597584268 info] api_store_parameter[239] -- add API parameter
)  Post Data endpoint healthy/unhealthy state.
[httpsd 4548 - 1597584268 info] endpoint_process_req_vdom[858] -- new API request (action='add',path='firewall',name='clearpass-address',vdom='root',user='ccpm')
[httpsd 4548 - 1597584268 info] build_firewall_addr_clearpass_install[3562] -- Add 77.77.77.77 with SPT 1. <----- Adding SPT IS '1'.
Indicates states as healthy.
[httpsd 4548 - 1597584268 info] fweb_debug_final[203] -- Completed POST request for "/api/v2/monitor/firewall/clearpass-address/add" (HTTP 200) <----- HTTP 200 OK indicates Successful.
 Run below to check the dynamic firewall list updating by API.
# diagnose firewall dynamic list
List all dynamic addresses:
cppm: ID(176)
ADDR(44.4.4.4)
ADDR(10.10.10.4)
ADDR(5.5.5.5)
ADDR(10.10.10.10)
ADDR(5.5.5.55)
ADDR(77.77.77.77) <----- New entry added here.
ADDR(172.16.80.203)
Related Articles
Technical Tip: How to call 'REST API' script through ClearPass application
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.
Copyright 2024 Fortinet, Inc. All Rights Reserved.