Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
emnoc
Esteemed Contributor III

dumping fwpolicies into a xls or csv format

Anybody seen any cool tools that will grab fwpolicies and dump them into a format to import into xls, or csv or any other method?

PCNSE 

NSE 

StrongSwan  

PCNSE NSE StrongSwan
1 Solution
TuncayBAS

Yes offcourse

 

I use fortigate rest api document.

 

http://www.tuncaybas.com/FOS_JSON_REST_API_523.pdf

 

Get all policy for 5.2 :

[link]https://192.168.0.1:443/api/cmdb?request=[/link]{'action':'select','path':'firewall','name':'policy','datasource':true,'skip':true,'with_meta':true}

 

Get all policy for 5.4 :

https://192.168.0.1:443/a..2/cmdb/firewall/policy/

 

This results json format.

{
"http_method":"GET",
"results":[
{
"policyid":7,
"q_origin_key":"7",
"name":"fatura-pc-deny",
"uuid":"53e964d2-36b8-51e6-a95c-9c146a1da1c8",
"srcintf":[
{
"name":"lan",
"q_origin_key":"lan"
}
],
"dstintf":[
{
"name":"wan1",
"q_origin_key":"wan1"
}
],
"srcaddr":[
{
"name":"all",
"q_origin_key":"all"
}
],

and parse with .net (or use other language).

 

Tuncay BAS RZK Muhendislik Turkey NSE 4 5 6 FCESP v5

View solution in original post

Tuncay BAS RZK Muhendislik Turkey NSE 4 5 6 FCESP v5
23 REPLIES 23
TuncayBAS

Unfortunately ! not yet. but we find ourselves examining the structure 5.4.

Tuncay BAS RZK Muhendislik Turkey NSE 4 5 6 FCESP v5

Tuncay BAS RZK Muhendislik Turkey NSE 4 5 6 FCESP v5
oheigl

Hey Tuncay, can you activate PM in the fortinet forum? I need to ask you something 

TuncayBAS

ok. PM status active.

Tuncay BAS RZK Muhendislik Turkey NSE 4 5 6 FCESP v5

Tuncay BAS RZK Muhendislik Turkey NSE 4 5 6 FCESP v5
FatalHalt

yaba wrote:

Policy export tool:

 

http://www.tuncaybas.com/...rtigate-policy-export/

Wait, is there no ability to export from a file? Without seeing the source code, I don't want to allow a program to log into my firewall...

Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors