Giter Site home page Giter Site logo

hatzelencio / lapf Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 44 KB

Overlapping Finder (a.k.a "lapf") is a tool made and built with Golang to find possible overlapping CIDR Block notation across the cloud providers. The easiest way to find overlaps over your AWS VPCs across regions

License: Apache License 2.0

Go 100.00%
aws overlap overlapping peer-to-peer vpc cidr cidr-notation

lapf's Introduction

LAPF - Overlapping Finder

Version: v0.0.7


How does it work?

NAME:
   Overlapping Finder - Overlapping Finder (a.k.a "lapf") is a binary-tool made and built in golang to find possible overlapping CIDR Block notation through cloud providers (AWS)

USAGE:
   Overlapping Finder [global options] command [command options] [arguments...]

COMMANDS:
   ipv4     lapf ipv4 192.168.0.0/24
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h        show help (default: false)
   --output value    Output format (default: text, json)
   --provider value  Cloud Provider (default: aws)

How to run it?

Retrieve the latest executable from GitHub releases and set up the execution permissions

curl -s https://api.github.com/repos/hatzelencio/lapf/releases/latest \
| grep "browser_download_url" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -
chmod u+x lapf*

Overlap

RAW Output

./lapf --provider aws ipv4 --region us-west-1 10.0.0.0/24
[X][10.0.0.0/24]	is overlapping at: "aws" (vpc-xxa)
[ ][10.0.0.0/24]	is not overlapping at: "aws" (vpc-xxb)
[ ][10.0.0.0/24]	is not overlapping at: "aws" (vpc-xxc)

JSON Output

./lapf --provider aws --output json \
  ipv4 --region us-west-1 \
  10.0.0.0/8
[
  {
    "CloudNetwork": {
      "Name": "vpc-aaaa",
      "ProviderName": "aws",
      "CidrBlock": "10.0.0.0/24"
    },
    "CurrentCidr": "10.0.0.0/8",
    "IsOverlap": true
  }
]

Streaming pipeline results with other accounts

[WARN] Bear in mind, flag --output json must be set up before pipelining your command, otherwise, you can not be able to performance it.

./lapf --output json --provider aws \
  ipv4 --profile blue --region us-west-1 10.0.0.0/24 | \
./lapf --provider aws \
  ipv4 --profile green --region us-east-1
[ ][10.0.0.0/24]	is not overlapping at: "aws GreenAccount" (vpc-zyw = Default [172.31.0.0/16])
[ ][10.0.0.0/24]	is not overlapping at: "aws GreenAccount" (vpc-zyv = GreenVpc [10.120.0.0/16])
[ ][10.0.0.0/24]	is not overlapping at: "aws BlueAccount" (vpc-abd = Default [172.31.0.0/16])
[X][10.0.0.0/24]	is overlapping at:     "aws BlueAccount" (vpc-abc = BlueVpc [10.0.0.0/16])

Is CIDR Block private?

RAW Output

./lapf ensure cidr 10.0.0.0/16 172.10.0.0/22 192.168.1.0/24
[✓][192.168.1.0/24] is private
[x][172.10.0.0/22] is not private
[✓][10.0.0.0/16] is private

JSON Output

Bear in mind, flag --show-ip-list only works over output json

./lapf --output json ensure cidr --show-ip-list 11.0.0.0/30 10.10.20.0/24
[
  {
    "cidr": "10.10.20.0/24",
    "isPrivate": true
  },
  {
    "cidr": "11.0.0.0/30",
    "isPrivate": false,
    "publicIPList": [
      "11.0.0.0",
      "11.0.0.1",
      "11.0.0.2",
      "11.0.0.3"
    ]
  }
]

Futures improvements

  • Ensuring input data
  • Fix default account credentials for AWS Provider
  • Support for ipv6
  • Adding other cloud providers like Azure, GCP
  • Adding testing
  • Adding the installation command

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.