Git Product home page Git Product logo

rev-proxy-grapher's Introduction

Reverse proxy grapher

This is a useful little tool that will generate a nice graphviz graph illustrating your reverse proxy flow. It takes a manually curated YAML file describing the topology of your network, proxy definitions, and optionally a collection of nmap output files for additional port/service information and output a graph in any format supported by graphviz.

Example graph produced

Usage

When run with --help:

usage: rev-proxy-grapher.py [-h] --topology TOPOLOGY [--resolve-dns]
                            [--nmap-xml NMAP_XML [NMAP_XML ...]]
                            [--limit-ext LIMIT_EXT [LIMIT_EXT ...]]
                            [--font FONT] [--fontsize FONTSIZE]
                            [--ranksep RANKSEP] [--out OUT] [--verbose]

Draw a nice graph of your external to internal proxies

optional arguments:
  -h, --help            show this help message and exit
  --topology TOPOLOGY   File describing the proxies and the topology of your
                        networks (default: topology.yaml)
  --resolve-dns         Attempt to resolve DNS for all IPs (default: False)
  --nmap-xml NMAP_XML [NMAP_XML ...]
                        Get additional node details from these nmap XML scan
                        files (default: ())
  --limit-ext LIMIT_EXT [LIMIT_EXT ...]
                        Only include these source IPs or networks (default:
                        ())
  --font FONT           Font to use in the graph (default: droid sans,dejavu
                        sans,helvetica)
  --fontsize FONTSIZE   Font size to use in the graph (default: 11)
  --ranksep RANKSEP     Node separation between columns (default: 1)
  --out OUT             Write graph into this file, guessing the output format
                        by extension (default: graph.png)
  --verbose             Be more verbose (default: False)

Requirements

  • python3-pydotplus
  • python3-PyYAML
  • python3-netaddr

Examples

See output of --help, and examples in the examples directory. To generate an example graph of your own, simply run:

rev-proxy-grapher.py --topology examples/topology.yaml

This will generate graph.png if everything worked well.

If you want to see what is added by running nmap:

rev-proxy-grapher.py \
    --topology examples/topology.yaml \
    --nmap-xml examples/nmap-external.xml \
    --out graph-with-nmap.svg

Limitations

Currently, this only supports one level of proxying. For example you cannot define a haproxy->nginx->lb-cluster relationship, but this will hopefully be coming in the future, as we have a need to get that properly represented anyway.

Authors

rev-proxy-grapher's People

Contributors

dfc avatar mricon 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

rev-proxy-grapher's Issues

Support for zones?

I would like to tag some of my cluster items as being part of a zone.

A zone is a subset of a subnet. For example two geographical locations sharing the same subnet or in my case VMs sharing the same network.

Graphically a zone would just be a rectangle with a colored border.

What do you think? Is is something that has a chance to be implemented?

PS: nmap won't be able to recognize them on its own.

nmap remove unreachable nodes

Currently the nmap feature does Get additional node details. In my case I would like to remove node or ports if nmap reports them unreachable.

From a security point of view, I can ensure that part of my infrastructure isn't reachable from a particular subnet.

Maybe this is not wanted as the default behavior, we could add a flag to activate it.

AttributeError: module 'nmap' has no attribute 'PortScanner'

I'm trying the grapher with an nmap dump, I have the following error:

AttributeError: module 'nmap' has no attribute 'PortScanner'

I'll probably solve it on my own but I would be great to document which version of the nmap module is required. Also could we add a requirements.yml file in the project?

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.