Skip to content

Script to parse fortigate configuration and output to xlsx, json and yaml

Notifications You must be signed in to change notification settings

SudarshanVK/fortigate-config-parser

Repository files navigation

Fortigate Configuration Parser Python 3.10 Code Style

Fortigate Configuration Parser

A toolkit to parse Fortigate CLI configuration and generate structured data.

The toolkit parses the output of the following Fortigate CLI commands:

  - show system interface
  - show firewall address
  - show firewall addrgrp
  - show firewall service custom
  - show firewall service group
  - show firewall policy
  - show router static

Installation

If using pip,

git clone https://github.com/SudarshanVK/fortigate-config-parser.git
cd fortigate-config-parser
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

If using poetry,

git clone https://github.com/SudarshanVK/fortigate-config-parser.git
cd fortigate-config-parser
poetry install
source .venv/bin/activate

Execution

The script requires the path to the configuration file as an argument.

python app/main.py --help
Usage: main.py [OPTIONS]

Options:
  -c, --configuration TEXT  Path to configuration file  [required]
  --help                    Show this message and exit.

Sample execution output

A sample execution screenshot is as below alt text

Output

The toolkit outputs the parsed configuration in three formats: JSON, YAML and XLSX. The outputs are stored in a dedicated folder in the parent directory.

Sample outputs can be found here

Author

Sudarshan Vijaya Kumar

About

Script to parse fortigate configuration and output to xlsx, json and yaml

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published