ccidr
ccidr
is a command line tool written in Go that help you get and filter Public Cloud IP address ranges.
Public clouds supported :
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())
}