FortiWeb
A FortiWeb can be configured to join a Security Fabric through the root or downstream FortiGate.
scheehan_FTNT
Article Id 194893

Description
Since firmware version v6.3.6, new RESTful API has been introduced in FortiWeb from v1.0 to v2.0.

This article describes how to create and update configuration object with RESTful API.

Scope
For version 6.3.6 and above.

Solution
Example configuration section:



 
 
Check RESTful API accessibility to FortiWeb with interested configuration 'ip-list':
curl -i --insecure --location --request GET 'https://{host}/api/v2.0/cmdb/waf/ip-list' --header 'Authorization: xxxxxxxxxxxxxx' --header 'Accept: applicaiton/json'



 
Check 'ip-list' members sub-object:
curl -i --insecure --location --request GET 'https://{host}/api/v2.0/cmdb/waf/ip-list?mkey=protection' --header 'Authorization: xxxxxxxxxxxxxx' --header 'Accept: applicaiton/json'
 
 

 
 
Modify existing configuration members object 'id:1 'from 'type: trust-ip' to 'type: black-ip':
curl -i --insecure --location --request PUT 'https://{host}/api/v2.0/cmdb/waf/ip-list/members?mkey=protection&sub_mkey=1' --header 'Authorization: xxxxxxxxxxxxxx' --header 'Accept: applicaiton/json' --data '{"data":{ "type": "black-ip"}}'



 
 
Create new configuration members 3rd entry under 'ip-list' 'protection':
curl -i --insecure --location --request POST 'https://{host}/api/v2.0/cmdb/waf/ip-list/members?mkey=protection' --header 'Authorization: xxxxxxxxxxxxxx' --header 'Accept: applicaiton/json' --data '{"data":{ "seq": 3, "id": "3", "type": "black-ip", "ip": "3.3.3.3"}}'
 
 

 
Final configuration after updated members id 1 and created members ID 3:
 
 
 
Notes.
FortiWeb configuration can vary for each unit.
 
To understand more about how to identify configuration objects, refer to below API guide section 'Use RESTful API to access CMDB':
https://documenter.getpostman.com/view/11233300/SzmZbfBD?version=latest


Related links:
https://docs.fortinet.com/document/fortiweb/6.3.6/release-notes
https://documenter.getpostman.com/view/11233300/SzmZbfBD?version=latest

Contributors