GithubHelp home page GithubHelp logo

ornulfn / psfortigateparser Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 5.0 120 KB

Parse and create CSV reports from a Fortigate configuration file

License: BSD 3-Clause "New" or "Revised" License

PowerShell 100.00%
powershell powershell-module fortigate fortigate-firewall fortinet csv-reports csv-files fortigate-configuration parse powershell-core

psfortigateparser's Introduction

PSFortigateParser

Introduction

The purpose of this Powershell module is to parse a Fortigate configuration file and create CSV reports.

CSV files are created with delimiter specified by system regional settings and will be saved using same encoding as specified for reading the config file. To open created CSV files in Excel, save files using .csv extension - double click on file to open it in Excel (Excel import wizard does not correctly parse multivalued cells using linefeed as separator).

Changelog

Detailed changes for each release are documented in the release notes.

Quickstart

Basic usage:

    # Open and parse a Fortigate config file using UTF8 encoding, save reports as CSV.
    $Config = New-PSFortigateReport -Params @('C:\firewall.conf', [System.Text.Encoding]::UTF8)
    $Config.savePolicyReport('C:\firewall-policy.csv')
    $Config.saveAddressReport('C:\firewall-address.csv')
    $Config.saveAddressGroupReport('C:\firewall-addressgroup.csv')
    $Config.saveServiceReport('C:\firewall-service.csv')
    $Config.saveServiceGroupReport('C:\firewall-servicegroup.csv')

psfortigateparser's People

Contributors

ornulfn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

psfortigateparser's Issues

Can't run module

Hi there,

First of all, I would like to thank you for sharing this module with us.

I am having an issue trying to load the module. I have copied it to %programfiles%\WindowsPowerShell\Modules, but if I try to run the commands specified on readme.md file, I receive the error:

"The term 'New-PSFortigateReport' is not recognized as the name of a cmdlet"

Could you, please, help me with this?

Only one csv creation works

Hi, @ornulfn , much appreciate for your share!
I've tested your script with several Fortigate .conf files and got the same results.
$Config.savePolicyReport('XXX\firewall-policy.csv') works well.

The rest functions such as saveAddressReport, saveServiceReport don't work.
It showed:
Line |
1704 | ConvertTo-Csv -NoTypeInformation -Delimiter (Get-Culture) โ€ฆ
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot bind argument to parameter 'InputObject' because it is null. ------------>>>>

Could you please double check your script?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.