Giter Club home page Giter Club logo

dfw-import's Introduction

dfw-import

This bash script helps importing a lis of FW rules in a cvs file into the NSX DFW. It should work in most of the linux distros available as it only uses curl and bash commands. Please inform your environemnt variables such as NSX Manager IP Address/FQDN and user in the respective fields before using the script.

The rules.list structure should follow the guidelines below to run sucessful importing

Field #

1 - Section/Policy name/id - it creates a security policy with this id/name or update one that exists

2 - Rule Name - it creates a rule with this id/name or update one that exists inside the security-policy informed in the first field

3 - Source - One or Many host IP Addresses or CIDRs. It should be informed individualy between double quotes and separated by comas e.g. "192.168.10.11","192.168.0.0/24"

4 - Destination - One or Many host IP Addresses or CIDRs. It should be informed individualy between double quotes and separated by comas e.g. "192.168.10.11","192.168.0.0/24"

5 - Protocol - Choice of ANY, TCP or UDP

6 - Port - None, One or Many destination ports. Ranges are supported. It should be informed individualy between double quotes and separated by comas e.g. "161-162","53","514"

7 - Action - Choice of ALLOW, DROP or REJECT

8 - Log - Choice of log or empty

For each rule the script will generate a .txt with the json used to run the API call and inform the status as below

Creating DFW Rule for regra1 with the Source IP Address "192.168.10.0/24" and Destination IP Address "192.168.10.10","192.168.10.11" for TCP and "80","443","8080"

When finishing the script will prompt an option to keep or delete the created json files.

Happy importing

David Santos

dfw-import's People

Contributors

dfgpsantos avatar

Watchers

 avatar

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.