Skip to content

Generate a current list of CIDR ranges covering public Google APIs and services.

License

Notifications You must be signed in to change notification settings

magnetikonline/google-api-cidr-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google API CIDR list

Script to generate a current list of CIDR ranges covering public Google APIs and services, such as Bigtable, Pub/Sub and Cloud Storage. IPv4 addresses are extracted from TXT record _spf.google.com as outlined by Google Cloud Platform VPC documentation.

Overview

The DNS record is walked recursively, following include: directives - although at time of writing (September 2018) the SPF rules only run two records deep. For simplicity DNS queries are performed by calls to dig.

Practical uses for this list:

  • Define route tables allowing GCP instances without public IP addresses access to the Internet via a NAT gateway plus optimized Google API access through private VPC access.
  • Firewall rules to allow only instance egress to Google APIs.

Usage

$ ./googleapicidrlist.py
108.177.8.0/21
108.177.96.0/19
130.211.0.0/22
172.217.0.0/19
...

Tests

Tests via test/googleapicidrlist.py.

About

Generate a current list of CIDR ranges covering public Google APIs and services.

Topics

Resources

License

Stars

Watchers

Forks

Languages