duyomer / Forti_Editor

Edit Fortigate Rules and Objects from a CSV file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Forti_Editor

Python script for creating Fortigate Rules and Objects from a CSV file.

Dependencies: Python-Paramiko is needed for ssh connection and command sending to the machine.

installation:
    Ubuntu sudo apt-get install python-paramiko
    CentOS yum install python-paramiko

The script gets 2 csv files:

  1. Rules
  2. Objects

With the following format:

Rules.csv:

Source Address,Destination Address,Source Interface,Destination Interface,Service,Schedule,Action,NAT

Objects.csv:

Object Name,Type,Subnet

Usage:

forti_cmd.py --file <RULES_FILE_PATH> <OBJECTS_FILE_PATH> <-a OR --add>
forti_cmd.py --file <RULES_FILE_PATH> <OBJECTS_FILE_PATH> <-d OR --delete> <RULE_ID>

Examples:
  forti_cmd.py --file /tmp/Rules.csv /tmp/Objects.csv -a --> add all rules in csv rules file
  forti_cmd.py --file /tmp/Rules.csv /tmp/Objects.csv -d 3 --> delete rule No. 3

About

Edit Fortigate Rules and Objects from a CSV file


Languages

Language:Python 100.0%