Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
Simon_Bingham
New Contributor II

Export configuration in a structured data format like YAML / XML / JSON, FortiGate-6501F v7.0.10

 

I do not care what format, it just needs to be better than the "full configuration" human-readable format. 


on a Juniper SRX , you can type
show config | display XML 
job done

I need to get my hands on the Fortigate config in a similar format. 

I've googled it, and the GUI I'm looking at it  does not seem to have the "export as YAML option. 
Is there a way to view the configuration in the CLI as XML or anything else?

Regards

Simon

 

PS also tried to post in this forum and failed. I get this

Post flooding detected (community received posts of a unique message more than one time within 3,600 seconds)

It makes it impossible to post here, trying again after one hour.

1 Solution
ozkanaltas
Valued Contributor III

Hello @Simon_Bingham ,

 

You can't access the configuration file on the filesystem. Because FortiOS is a hardened operating system. Also, I think the configuration running on FortiOS and the backup file use the same structure.

 

 

If you have found a solution, please like and accept it to make it easily accessible to others.
NSE 4-5-6-7 OT Sec - ENT FW

View solution in original post

If you have found a solution, please like and accept it to make it easily accessible to others.NSE 4-5-6-7 OT Sec - ENT FW
4 REPLIES 4
ozkanaltas
Valued Contributor III

Hello @Simon_Bingham ,

 

After version 7.2, you can download the backup file in yaml format.

 

https://docs.fortinet.com/document/fortigate/7.2.0/new-features/787595/backing-up-and-restoring-conf...

 

But, on version 7.0 you can just download FortiGate default format. 

If you have found a solution, please like and accept it to make it easily accessible to others.
NSE 4-5-6-7 OT Sec - ENT FW
If you have found a solution, please like and accept it to make it easily accessible to others.NSE 4-5-6-7 OT Sec - ENT FW
Simon_Bingham

Thanks, do you know how the config is held internally on the devices? is this hidden in the linux OS anywhere that we can access ?, I'm just thinking the real config file that the device uses to boot must be somewhere. 

 

ozkanaltas
Valued Contributor III

Hello @Simon_Bingham ,

 

You can't access the configuration file on the filesystem. Because FortiOS is a hardened operating system. Also, I think the configuration running on FortiOS and the backup file use the same structure.

 

 

If you have found a solution, please like and accept it to make it easily accessible to others.
NSE 4-5-6-7 OT Sec - ENT FW
If you have found a solution, please like and accept it to make it easily accessible to others.NSE 4-5-6-7 OT Sec - ENT FW
Simon_Bingham

Thank you for responding, it looks like I will need to write a script to convert this into something structured. Thanks. 

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