Git Product home page Git Product logo

non_compliant_device_finder's Introduction

non_compliant_device_finder.py

A script to let you query an ExtraHop EDA/Reveal(x) EDA to find devices who's names don't match a particular regex. This can be as simple as a 'starts with' regex like '^VMware' or as complex as your naming standards require. The idea is that you can run the script via a cron job, either specifying the API token on the command line or you can have it saved to a file in the user's home directory (.extrahop). This will then allow you to call the script with only a single parameter (the IP address or name of the ExtraHop Explore Appliance) and have it output a CSV file with all the non-compliant device names for further processing.

For full usage information, run the script with the -h option. As at version 1.0, the output looks like this:

usage: non_compliant_name_finder.py [-h] -H HOST [-a APIKEY] [-o OUTPUTFILE]
                                    [-d DAYS] [-r REGEX] [-l LIMIT]
                                    [-O OFFSET] [-v | -q]

Usage: non_compliant_name_finder.py [options]

optional arguments:

  -h, --help show this help message and exit
  -H HOST, --host HOST  IP or hostname of ExtraHop appliance
  -a APIKEY, --apikey APIKEY API token obtained from the ExtraHop system
  -o OUTPUTFILE, --outputfile OUTPUTFILE Name of the file to save the results to (default:
                        non_compliant_server_names)
  -d DAYS, --days DAYS  Number of days of lookback history to search (default: 7 days)
  -r REGEX, --regex REGEX The RegEx pattern to use in the device name search (default "^VMware")
  -l LIMIT, --limit LIMIT Limit the number of results (for pagination) (default: 100)
  -O OFFSET, --offset OFFSET Offset to search from (for pagination - use with the
                        -l/--limit switch (default: 0)
  -v, --verbose
  -q, --quiet

Example: python3 non_compliant_name_finder.py -H 192.168.0.16 -v -o devices -r^ASUS -O100 -l100

To save the API token to the .extrahop file, just specify the ExtraHop EDA IP address or name on the command line, supply the token when prompted then select 'y' or 'yes' when asked if you want to save this. The next invocation of the script will search for the IP or hostname in the file and run without interaction.

Any suggestions, please email [email protected]

non_compliant_device_finder's People

Contributors

petesyboy avatar

Watchers

 avatar  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.