ccidr

module
v1.0.200 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2024 License: Apache-2.0

README

ccidr

build release files-update

ccidr is a command line tool written in Go that help you get and filter Public Cloud IP address ranges.

Public clouds supported :

  • Azure
  • AWS

The IP address ranges for each cloud are included in the binaries. A new version will be release on monday each week with update IP address ranges. If you don't want to update on a weekly basis, you can use the --remote flag to fetch the information directly from the source :

Demo

Examples

  • Prints All Azure regions

    ccidr azure regions
    
  • Prints All AWS regions

    ccidr aws regions
    
  • Prints All Azure services

    ccidr azure services
    
  • Prints All Azure IP address ranges

    ccidr azure ips
    
  • Prints All AWS IP address ranges

    ccidr aws ips
    
  • Prints All Azure IP address ranges for a specific region

    ccidr azure ips -r eastus
    
  • Prints All Azure IP address ranges for a specific service

    ccidr azure ips -s AppService
    
  • Prints All Azure IP address ranges for a specific service and region

    ccidr azure ips -s AppService -r eastus
    
  • Prints All Azure IP address ranges for a specific service and region using the remote source of data

    ccidr azure ips -s AppService -r eastus --remote
    

Installation

The Go Get way
go get -u github.com/runoncloud/ccidr/cmd/ccidr
Binaries
OSX
latestVersion=$(curl --silent "https://api.github.com/repos/runoncloud/ccidr/releases/latest" | jq -r .tag_name) && \
  curl -L -o ccidr.gz https://github.com/runoncloud/ccidr/releases/download/$latestVersion/ccidr_darwin_amd64.tar.gz && \
  tar zxvf ccidr.gz && chmod +x ccidr && mv ccidr $GOPATH/bin/
Linux
latestVersion=$(curl --silent "https://api.github.com/repos/runoncloud/ccidr/releases/latest" | jq -r .tag_name) &&
  curl -L -o ccidr.gz https://github.com/runoncloud/ccidr/releases/download/$latestVersion/ccidr_linux_amd64.tar.gz && \
  tar zxvf ccidr.gz && chmod +x ccidr && mv ccidr $GOPATH/bin/
From source

Requirements:

  • go 1.13 or newer
  • GNU make
  • git
make bin        # binaries will be placed in bin/

Use ccidr as a library

package main

import (
   "fmt"
   "github.com/runoncloud/ccidr/pkg/ccidr"
)

func main() {
   azure := ccidr.Azure{}
   aws := ccidr.AWS{isRemote: true}
   
   fmt.Println(azure.ListAddressPrefixes())
   fmt.Println(aws.ListAddressPrefixes())
}

Directories

Path Synopsis
cmd
cli
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL