Skip to content

Python script to create/update an OPNsense alias with the IPs used for Google's APIs

License

Notifications You must be signed in to change notification settings

corey-braun/google-api-ips

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google-api-ips

Python script for creating/updating an OPNsense alias with the IP networks used by Google for its APIs and services. This is done by removing the set of IPs handed out to Google Cloud customers from the set of all publicly accessible Google IPs.
See https://support.google.com/a/answer/10026322 for more information.

The list of CIDR-notation IP networks can also be printed to stdout or written to a file if you are not using OPNsense.

The script uses a YAML configuration file, see the comments in config.yml for information on configuring the script.

If using the script to update an OPNsense alias it is recommended to create the OPNsense API key on a user with only the permission "Firewall: Alias: Edit". This minimizes the damage that can be done if the key is compromised.

See this related blog post for details on how I use this script to connect Home Assistant to Google Assistant:
https://coreybraun.com/posts/google-assistant-home-assistant/

About

Python script to create/update an OPNsense alias with the IPs used for Google's APIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages