Giter Club home page Giter Club logo

fgpoliciestocsv's People

Contributors

hobgoblinsmaster avatar maaaaz 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fgpoliciestocsv's Issues

Convert Local User

Hi can you create a script to convert "config user local" to csv? I would I collect all user data into spreadsheet.

Hope you can help

Thanks in advance

Multi-line records

This was a welcome find which greatly helps exporting FortiGate configs for PCI. Thank you for this!

A nice improvement would be the ability to specify the delimiter within a given field in a record. For example, if I have a firewall policy which allows multiple ports, currently the exported file separates each port with a space, however I may have custom ports that have spaces in their names, which can cause confusion. It would be nice to be able to specify a comma or other custom character to separate them.

Keep up the good work!

Help needed urgently with the file fgpoliciestocsv.py

Hi ,

I m trying to use your python script and getting the following error. Can you please help asap?

D:\Users\somaniv>csvparse.py -i rules1.cfg
Traceback (most recent call last):
File "D:\Users\somaniv\csvparse.py", line 160, in
main(options, arguments)
File "D:\Users\somaniv\csvparse.py", line 145, in main
results, keys = parse(options.input_file)
File "D:\Users\somaniv\csvparse.py", line 77, in parse
if p_entering_policy_block.search(line):
TypeError: cannot use a string pattern on a bytes-like object

Please convert the txt file to cfg file.

rules1.txt

TypeError: cannot use a string pattern on a bytes-like object

Good afternoon,
Took me some time on the Internet to find a useful script like this. But for some reason, I'm getting errors. I've tried to search on Google for this error, encountered some fixes too ... But I'm afraid I have no idea how to apply them.

Y:\Test>fgaddressestocsv.py -i "Y:\Test\sys_config_10.36.25.9.txt" -n
Traceback (most recent call last):
  File "Y:\Test\fgaddressestocsv.py", line 159, in <module>
    main(options, arguments)
  File "Y:\Test\fgaddressestocsv.py", line 145, in main
    results, keys = parse(options.input_file)
  File "Y:\Test\fgaddressestocsv.py", line 77, in parse
    if p_entering_address_block.search(line):

TypeError: cannot use a string pattern on a bytes-like object

This error happens also at other Python files in this repository.

This is the Python version I'm using;
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) [MSC v.1900 32 bit (Intel)] on win32

UTF 8 encoding for csvs

fgservicestocsv.py

Encoding is not set by default [](url
Capture
)

fixed by setting encoder to utf-8 in Line 155:

with io.open(options.output_file, mode=fd_write_options,encoding="UTF-8") as fd_output:

fixed error for me

Addresses to CSV

Hi Maaaaz,

i was trying to execute the python which u have created in terminal or output console Please specify a valid input file is printing the output. can u plz help me the how to insert input file in that code.

Thanks.

Address and tags

Hi,

In fgaddressestocsv.py, if the address contains "tagging" the script stop to parse the file.

    edit "Test"
        set uuid *****
        config tagging
            edit "UPG_TAGGING"
                set category "default"
                set tags "SERVER"
            next
        end
        set subnet 192.168.1.1 255.255.255.255
    next

Export viirutal ip to CSV

Hi, thank's for your work

possible to create script for export Virtual ip en ip pool to csv file?

thank's

When i use fgaddressestocsv.py , it doesn´t work

Good afternoon,
I find a useful script : fgaddressestocsv.py (Also fgpoliciestocsv.py , and it works ok).

But for some reason, I'm getting errors.

I've tried to search on Google for this error, But I'm afraid I have no idea how to apply them.

C:\PYTHON_POLICY_FORTIGATE\fgpoliciestocsv-master>python fgaddressestocsv.py -i prueba-address.cfg -n
Traceback (most recent call last):
File "fgaddressestocsv.py", line 179, in
main()
File "fgaddressestocsv.py", line 174, in main
generate_csv(results, keys, options)
File "fgaddressestocsv.py", line 151, in generate_csv
spamwriter.writerow(output_line)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-2: ordinal not in range(128)

This is the Python version I'm using;
python --version
Python 2.7.18

Is it possible , you give me some advice , please?

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.