Go to file
2021-12-24 12:46:57 +01:00
.github/workflows Fix workflow yaml 2021-12-24 12:46:57 +01:00
digaws Return an empty array when there is no data for json output 2021-02-19 17:46:04 +01:00
tests Fix test 2021-02-19 17:45:07 +01:00
.gitignore First commit 2020-12-25 21:36:41 +01:00
LICENSE First commit 2020-12-25 21:36:41 +01:00
noxfile.py Install missing stubs for mypy 2021-07-01 19:51:08 +02:00
README.md Add badges to README.md 2020-12-26 18:50:48 +01:00
requirements_test.txt First commit 2020-12-25 21:36:41 +01:00
requirements.txt First commit 2020-12-25 21:36:41 +01:00
setup.py Fix license at setup.py 2020-12-28 14:01:44 +01:00

digaws

The digaws lookup tool displays information for a given IP address (v4 o v6) or a CIDR, sourced from the AWS official IP ranges. In order to save bandwidth and time this tool requests the AWS IP ranges and keeps a cached version until a new version is published.

PyPI version CI

Requirements

Python >= 3.7

Tests are verified on Linux, macos and Windows.

Install

pip install digaws

Usage

usage: digaws [-h] [--output <plain|json>] [--output-fields [{prefix,region,service,network_border_group} ...]] [--debug] [--version] <ip address|cidr> [<ip address|cidr> ...]

Look up canonical information for AWS IP addresses and networks

positional arguments:
  <ip address|cidr>     CIDR or IP (v4 or v6) to look up

optional arguments:
  -h, --help            show this help message and exit
  --output <plain|json>
                        Formatting style for command output, by default plain
  --output-fields [{prefix,region,service,network_border_group} ...]
                        Print only the given fields
  --debug               Enable debug
  --version             show program's version number and exit

Examples

  • look up an IPv4 address
~ » digaws 52.218.97.130

Prefix: 52.218.0.0/17
Region: eu-west-1
Service: AMAZON
Network border group: eu-west-1

Prefix: 52.218.0.0/17
Region: eu-west-1
Service: S3
Network border group: eu-west-1
  • look up an IPv6 address
~ » digaws 2600:1f1e:fff:f810:a29b:cb50:2812:e2dc

IPv6 Prefix: 2600:1f1e::/36
Region: sa-east-1
Service: AMAZON
Network border group: sa-east-1

IPv6 Prefix: 2600:1f1e:fff:f800::/53
Region: sa-east-1
Service: ROUTE53_HEALTHCHECKS
Network border group: sa-east-1

IPv6 Prefix: 2600:1f1e::/36
Region: sa-east-1
Service: EC2
Network border group: sa-east-1
  • look up several addresses and print output as json
~ » digaws 2600:1f14::/36 13.224.119.88 --output json

[
  {
    "ipv6_prefix": "2600:1f14::/35",
    "region": "us-west-2",
    "service": "AMAZON",
    "network_border_group": "us-west-2"
  },
  {
    "ipv6_prefix": "2600:1f14::/35",
    "region": "us-west-2",
    "service": "EC2",
    "network_border_group": "us-west-2"
  },
  {
    "ip_prefix": "13.224.0.0/14",
    "region": "GLOBAL",
    "service": "AMAZON",
    "network_border_group": "GLOBAL"
  },
  {
    "ip_prefix": "13.224.0.0/14",
    "region": "GLOBAL",
    "service": "CLOUDFRONT",
    "network_border_group": "GLOBAL"
  }
]
  • Choose output fields
~ » digaws 34.255.166.63 --output-fields service

Service: AMAZON

Service: EC2