Skip to content

m3hr4nn/googleipmonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ Google IP Monitor

Automated monitoring of Google's IP ranges with real-time alerts, interactive charts, and firewall rule exports

GitHub Actions Python Telegram License

Live Dashboard โ€ข Chart Analytics โ€ข Export Rules โ€ข Roadmap


๐Ÿ“ธ View Live Dashboard โ†’


๐ŸŽฏ Overview

Google IP Monitor is an automated infrastructure monitoring tool that tracks changes in Google Cloud and Google Public IP ranges. Built for DevOps engineers, network administrators, and security teams who need to stay informed about Google's infrastructure changes.

Why Google IP Monitor?

  • ๐Ÿ”” Real-time Alerts - Get instant Telegram notifications every 3 hours when IP ranges change
  • ๐Ÿ“ˆ Interactive Charts - Visualize IP growth trends with Chart.js (Line, Bar, Pie charts)
  • ๐Ÿ”ฅ Firewall Export - Download ready-to-use rules for 9+ firewall formats (iptables, AWS, Azure, Cisco, pfSense, MikroTik, etc.)
  • ๐Ÿ“Š Visual Dashboard - Beautiful Chrome-inspired dark theme interface
  • ๐Ÿ—๏ธ Microservices Architecture - Modular, scalable, and maintainable design
  • ๐Ÿค– Fully Automated - Runs every 3 hours via GitHub Actions, zero maintenance
  • ๐Ÿ’ฐ 100% Free - No servers, no costs, forever
  • ๐Ÿ“ˆ Historical Tracking - All changes stored in Git for audit trails
  • ๐Ÿ”’ Secure - No API keys exposed, runs in isolated GitHub environment

โœจ Features

๐Ÿš€ Core Features

Feature Description
Every 3 Hours Monitoring Automatically checks Google's IP ranges 8 times per day
Change Detection Identifies added and removed IP prefixes with detailed diff reports
Interactive Charts Line, Bar, and Pie charts showing historical trends and analytics
Telegram Alerts Instant notifications with formatted summaries of changes
9 Export Formats Download firewall rules for iptables, AWS, Azure, Cisco, pfSense, MikroTik, CSV, JSON, Plain Text
Chart Data Exports Export historical metrics in CSV, JSON, and Markdown formats
Web Dashboard Responsive, dark-themed interface showing current status and history
Microservices Backend 5 independent services for scalability and maintainability
Git-based Storage All data versioned and tracked in GitHub
Multi-source Monitors both cloud.json and goog.json endpoints

๐Ÿ”ฅ Firewall Export Formats

Cloud Providers

  • โ˜๏ธ AWS Security Group JSON
  • ๐Ÿ”ท Azure NSG Rules JSON

Network Equipment

  • ๐ŸŒ Cisco IOS ACL
  • ๐Ÿ”ง MikroTik RouterOS Script

Firewalls

  • ๐Ÿง iptables/ip6tables Script
  • ๐Ÿ›ก๏ธ pfSense Alias Format

Data Formats

  • ๐Ÿ“Š CSV (Excel compatible)
  • ๐Ÿ“ฆ JSON (Structured data)
  • ๐Ÿ“„ Plain Text List

๐Ÿ“ฑ Telegram Notifications

๐Ÿ“Š Google IP Ranges Report
๐Ÿ“… Date: 2025-10-10 15:00
========================================

๐Ÿ”” Changes detected!

โž• Added (3):
  โ€ข 34.128.0.0/16
  โ€ข 35.192.0.0/14
  โ€ข 2600:1900::/35

๐Ÿ“Š Statistics:
  Previous: 1,234 ranges
  Current: 1,236 ranges
  Net change: +2

๐ŸŒ Dashboard Features

  • Live Statistics - Current vs previous day comparison
  • Historical Charts - Interactive visualizations with Chart.js
    • ๐Ÿ“ˆ Line Chart: IP range growth over time
    • ๐Ÿ“Š Bar Chart: Daily changes (last 30 days)
    • ๐Ÿฅง Pie Chart: IPv4 vs IPv6 distribution
  • Change Tracking - Color-coded additions and removals
  • One-Click Export - Download firewall rules in your preferred format
  • Chart Data Exports - Export metrics to CSV, JSON, Markdown
  • Responsive Design - Works on desktop, tablet, and mobile
  • Fast Navigation - Quick access to exports and historical data

๐ŸŽฏ Use Cases

๐Ÿข For Organizations

1. Security & Compliance

  • โœ… Maintain up-to-date firewall rules for Google services
  • โœ… Audit trail for regulatory compliance (SOC2, ISO 27001)
  • โœ… Detect unauthorized IP range changes
  • โœ… Export rules for automated deployment pipelines

2. Network Administration

  • โœ… Update VPN and proxy configurations automatically
  • โœ… Maintain accurate routing tables
  • โœ… Monitor Google Cloud infrastructure expansion
  • โœ… Generate router configs for Cisco/MikroTik

3. DevOps & SRE

  • โœ… Sync infrastructure-as-code with latest Google IPs
  • โœ… Prevent service disruptions due to IP changes
  • โœ… Automate terraform/ansible configuration updates
  • โœ… Import into AWS/Azure security groups

๐Ÿ‘ค For Individuals

4. Email Security

  • โœ… Validate Google Workspace sender IPs
  • โœ… Update SPF records for custom domains
  • โœ… Detect email spoofing attempts
  • โœ… Configure mail server whitelists

5. API Integration

  • โœ… Whitelist Google service IPs for API endpoints
  • โœ… Secure webhooks and callbacks
  • โœ… Validate incoming requests
  • โœ… Configure CDN and WAF rules

6. Research & Analytics

  • โœ… Track Google's infrastructure growth
  • โœ… Geographic distribution analysis
  • โœ… Network topology research
  • โœ… Export data for custom analysis

๐Ÿš€ Quick Start

Prerequisites

  • GitHub account
  • Telegram account (optional but recommended)
  • 5 minutes of your time

Step 1: Create Telegram Bot (Optional)

  1. Open Telegram and search for @BotFather
  2. Send: /newbot
  3. Follow the prompts and save your Bot Token
  4. Get your Chat ID from @userinfobot

Step 2: Fork & Configure

  1. Fork this repository

    https://github.com/m3hr4nn/googleipmonitor
    
  2. Add GitHub Secrets (if using Telegram)

    • Go to Settings โ†’ Secrets and variables โ†’ Actions
    • Add TELEGRAM_BOT_TOKEN
    • Add TELEGRAM_CHAT_ID
  3. Enable GitHub Actions

    • Go to Actions tab
    • Click "I understand my workflows, go ahead and enable them"
  4. Enable GitHub Pages

    • Go to Settings โ†’ Pages
    • Source: Deploy from branch main โ†’ / (root)
    • Click Save

Step 3: Run First Monitoring

Actions โ†’ Google IP Monitor โ†’ Run workflow

๐ŸŽ‰ Done! Your dashboard will be live in 2-3 minutes at:

  • Dashboard: https://YOUR_USERNAME.github.io/googleipmonitor/
  • Chart Analytics: https://YOUR_USERNAME.github.io/googleipmonitor/exports/charts/
  • Firewall Exports: https://YOUR_USERNAME.github.io/googleipmonitor/exports/

๐Ÿ“Š Architecture

High-Level Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                GitHub Actions (Every 3 Hours)                        โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚  Fetch IPs  โ”‚โ”€โ”€โ–ถโ”‚ Compare Data โ”‚โ”€โ”€โ–ถโ”‚ Generate Dashboard      โ”‚ โ”‚
โ”‚  โ”‚  from Googleโ”‚   โ”‚  Find Changesโ”‚   โ”‚  + Charts (via Gateway) โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚                    โ”‚                         โ”‚
           โ–ผ                    โ–ผ                         โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚   Git    โ”‚         โ”‚ Telegram โ”‚             โ”‚  GitHub  โ”‚
    โ”‚ History  โ”‚         โ”‚   Bot    โ”‚             โ”‚  Pages   โ”‚
    โ”‚ + Cache  โ”‚         โ”‚          โ”‚             โ”‚ Dashboardโ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Microservices Architecture (v1.1.0+)

generate_report.py
    โ†“
ChartAPIGateway (Orchestrator)
    โ†“
    โ”œโ†’ [1] DataAggregatorService โ”€โ”€โ”€โ”€โ–ถ cache/metrics.json
    โ†“
    โ”œโ†’ [2] ChartConfigService โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ cache/chart_configs.json
    โ†“
    โ”œโ†’ [3] ChartRendererService โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ HTML/JavaScript
    โ†“
    โ””โ†’ [4] ChartExportService โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ exports/charts/*
    โ†“
Return to generate_report.py โ”€โ”€โ–ถ Inject into index.html

5 Independent Microservices:

  1. DataAggregatorService - Parse historical data and compute metrics
  2. ChartConfigService - Generate Chart.js configurations
  3. ChartRendererService - Render HTML/JavaScript components
  4. ChartExportService - Export data in multiple formats
  5. ChartAPIGateway - Orchestrate all services with error handling

For detailed architecture documentation, see CLAUDE.md


๐Ÿ”ฅ Firewall Export Guide

Quick Export

  1. Visit: https://YOUR_USERNAME.github.io/googleipmonitor/exports/
  2. Click on your desired format
  3. Download and deploy!

Format Details

๐Ÿง iptables

# Download and apply
wget https://YOUR_USERNAME.github.io/googleipmonitor/exports/iptables.sh
chmod +x iptables.sh
sudo ./iptables.sh

โ˜๏ธ AWS Security Group

# Import via AWS CLI
aws ec2 create-security-group \
  --group-name google-ips \
  --description "Google IP Ranges" \
  --cli-input-json file://aws-security-group.json

๐Ÿ”ท Azure NSG

# Import via Azure CLI
az network nsg create \
  --resource-group myResourceGroup \
  --name GoogleIPs
az network nsg rule create \
  --nsg-name GoogleIPs \
  --cli-input-json @azure-nsg.json

๐ŸŒ Cisco ACL

! Copy/paste into Cisco IOS config
! File: cisco-acl.txt
configure terminal
[paste contents here]
end
write memory

๐Ÿ›ก๏ธ pfSense

1. Go to Firewall > Aliases
2. Click "Import"
3. Upload pfsense-alias.txt
4. Apply changes

๐Ÿ”ง MikroTik

# Upload and execute
/import file=mikrotik.rsc

๐Ÿ› ๏ธ Configuration

Customize Schedule

Edit .github/workflows/monitor.yml:

schedule:
  # Run every 3 hours (default)
  - cron: '0 */3 * * *'
  
  # Or run every hour
  - cron: '0 * * * *'
  
  # Or run twice daily at 9 AM and 9 PM UTC
  - cron: '0 9,21 * * *'

Add More Data Sources

Edit monitor.py:

self.urls = {
    'cloud': 'https://www.gstatic.com/ipranges/cloud.json',
    'goog': 'https://www.gstatic.com/ipranges/goog.json',
    'custom': 'https://your-source.com/ips.json'  # Add your source
}

Customize Charts

Edit config/chart_settings.json:

{
  "enabled": true,
  "days_to_show": 90,
  "charts": {
    "line_chart": {"enabled": true, "height": 400},
    "bar_chart": {"enabled": true, "height": 350},
    "pie_chart": {"enabled": true, "height": 320}
  }
}

Customize Theme

Edit styles.css to change colors:

:root {
    --accent-blue: #8ab4f8;   /* Primary accent */
    --accent-green: #81c995;  /* Success/additions */
    --accent-red: #f28b82;    /* Errors/removals */
}

Disable Telegram (Export Only Mode)

If you just want exports without Telegram notifications:

  1. Don't add the Telegram secrets
  2. The workflow will still run and generate exports
  3. You'll see "Telegram credentials not set" in logs (this is fine)

๐Ÿ”ฎ Roadmap

See the detailed ROADMAP.md for:

  • โœ… Completed features (v1.0.0 - v1.1.0)
  • ๐Ÿšง In-progress development
  • ๐Ÿ“‹ Planned features with timelines
  • ๐Ÿ’ก Feature request process
  • ๐Ÿ“… Release schedule

Want a feature? Create an issue or vote with ๐Ÿ‘ on existing requests!


๐Ÿค Contributing

Contributions are what make the open-source community amazing! Any contributions you make are greatly appreciated.

How to Contribute

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Guidelines

  • Follow PEP 8 style guide for Python code
  • Add comments for complex logic
  • Test your changes locally before submitting
  • Update documentation if you add new features

๐Ÿ“ Development

Local Setup

# Clone the repo
git clone https://github.com/m3hr4nn/googleipmonitor.git
cd googleipmonitor

# Install dependencies
pip install -r requirements.txt

# Set environment variables (optional)
export TELEGRAM_BOT_TOKEN="your-token"
export TELEGRAM_CHAT_ID="your-chat-id"

# Run locally
python monitor.py                    # Fetch and compare IPs
python generate_report.py            # Generate dashboard with charts
python generate_firewall_rules.py    # Generate exports

# Test microservices (v1.1.0+)
python services/chart_api_gateway.py # Test full chart pipeline

# View locally
open index.html                      # Main dashboard
open exports/charts/index.html       # Chart data exports
open exports/index.html              # Firewall exports

Project Structure

googleipmonitor/
โ”œโ”€โ”€ .github/workflows/
โ”‚   โ””โ”€โ”€ monitor.yml              # GitHub Actions (every 3 hours)
โ”œโ”€โ”€ services/                    # ๐Ÿ†• Microservices (v1.1.0)
โ”‚   โ”œโ”€โ”€ aggregator_service.py    # Data aggregation
โ”‚   โ”œโ”€โ”€ chart_config_service.py  # Chart configurations
โ”‚   โ”œโ”€โ”€ chart_renderer_service.py # HTML rendering
โ”‚   โ”œโ”€โ”€ chart_export_service.py  # Data exports
โ”‚   โ””โ”€โ”€ chart_api_gateway.py     # Service orchestrator
โ”œโ”€โ”€ config/                      # ๐Ÿ†• Configuration (v1.1.0)
โ”‚   โ””โ”€โ”€ chart_settings.json      # Chart customization
โ”œโ”€โ”€ cache/                       # ๐Ÿ†• Service cache (v1.1.0)
โ”‚   โ”œโ”€โ”€ metrics.json             # Aggregated metrics
โ”‚   โ””โ”€โ”€ chart_configs.json       # Chart.js configs
โ”œโ”€โ”€ data/                        # Historical IP snapshots
โ”‚   โ””โ”€โ”€ YYYY-MM-DD.json
โ”œโ”€โ”€ exports/
โ”‚   โ”œโ”€โ”€ charts/                  # ๐Ÿ†• Chart data exports (v1.1.0)
โ”‚   โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”‚   โ”œโ”€โ”€ historical_metrics.csv
โ”‚   โ”‚   โ”œโ”€โ”€ historical_metrics.json
โ”‚   โ”‚   โ””โ”€โ”€ summary.md
โ”‚   โ”œโ”€โ”€ index.html               # Firewall export dashboard
โ”‚   โ”œโ”€โ”€ iptables.sh              # Linux firewall
โ”‚   โ”œโ”€โ”€ aws-security-group.json  # AWS format
โ”‚   โ”œโ”€โ”€ azure-nsg.json           # Azure format
โ”‚   โ”œโ”€โ”€ cisco-acl.txt            # Cisco IOS
โ”‚   โ”œโ”€โ”€ pfsense-alias.txt        # pfSense
โ”‚   โ”œโ”€โ”€ mikrotik.rsc             # MikroTik
โ”‚   โ”œโ”€โ”€ plain-text.txt           # Plain text
โ”‚   โ”œโ”€โ”€ export.csv               # CSV format
โ”‚   โ””โ”€โ”€ export.json              # JSON format
โ”œโ”€โ”€ monitor.py                   # Core monitoring logic
โ”œโ”€โ”€ generate_report.py           # Dashboard + charts generator
โ”œโ”€โ”€ generate_firewall_rules.py   # Firewall export generator
โ”œโ”€โ”€ styles.css                   # Dashboard styling
โ”œโ”€โ”€ index.html                   # Main dashboard (auto-generated)
โ”œโ”€โ”€ CLAUDE.md                    # Architecture documentation
โ”œโ”€โ”€ ROADMAP.md                   # ๐Ÿ†• Product roadmap (v1.1.0)
โ”œโ”€โ”€ requirements.txt             # Python dependencies
โ””โ”€โ”€ README.md                    # You are here!

Adding a New Export Format

  1. Edit generate_firewall_rules.py
  2. Add your generator method:
def generate_your_format(self, ipv4_prefixes, ipv6_prefixes):
    rules = []
    # Your format logic here
    for ip in ipv4_prefixes:
        rules.append(f"your-format: {ip}")
    return "\n".join(rules)
  1. Add to the formats dictionary in generate_all():
formats = {
    'your-format.txt': self.generate_your_format,
    # ... other formats
}
  1. Update the exports index page to include your format

๐Ÿ“Š Dashboard Preview

๐ŸŒ Main Dashboard

Beautiful dark-themed interface with real-time statistics, interactive charts, and change tracking.

Features:

  • ๐Ÿ“Š Live statistics cards (Previous Day, Current Day, Net Change, IPv4/IPv6)
  • ๐Ÿ“ˆ Interactive charts (Line, Bar, Pie charts with Chart.js)
  • ๐ŸŽจ Chrome-inspired dark theme
  • ๐Ÿ”ฅ Integrated exports with 9 formats
  • ๐Ÿ“ฑ Fully responsive design

๐Ÿ‘‰ View Live Dashboard

๐Ÿ“ˆ Chart Analytics Page

Export and analyze historical IP range metrics.

Available Exports:

  • ๐Ÿ“Š CSV for Excel analysis
  • ๐Ÿ“ฆ JSON for API consumption
  • ๐Ÿ“„ Markdown for documentation

๐Ÿ‘‰ Browse Chart Data

๐Ÿ”ฅ Firewall Export Page

Download ready-to-use firewall rules in your preferred format.

Available Formats:

  • ๐Ÿง iptables/ip6tables โ€ข โ˜๏ธ AWS Security Group โ€ข ๐Ÿ”ท Azure NSG
  • ๐ŸŒ Cisco ACL โ€ข ๐Ÿ›ก๏ธ pfSense โ€ข ๐Ÿ”ง MikroTik RouterOS
  • ๐Ÿ“„ Plain Text โ€ข ๐Ÿ“Š CSV โ€ข ๐Ÿ“ฆ JSON

๐Ÿ‘‰ Browse Exports


โ“ FAQ

How often does it check for changes? Every 3 hours (8 times per day). You can customize this in the workflow file.
What firewall formats are supported? Currently: iptables, AWS Security Group, Azure NSG, Cisco ACL, pfSense, MikroTik, CSV, JSON, and Plain Text. More formats can be added easily!
Do I need Telegram to use this? No! Telegram is optional. The dashboard and exports work without it. Just don't add the Telegram secrets.
How do I import rules into my firewall? Check the "Firewall Export Guide" section above for specific instructions for each format.
Can I monitor other IP sources besides Google? Yes! Add any JSON/text IP source to the `urls` dictionary in `monitor.py`.
Will this use up my GitHub Actions quota? No. With 2,000 free minutes/month and ~2 minutes per run, you use only 480 minutes/month (24% of quota).
Can I run this on my own server? Yes! Set up a cron job to run the Python scripts. But GitHub Actions is easier and free!
How do I update to the latest version? Sync your fork with the upstream repository, or manually copy new files from the main repo.

๐Ÿ“„ License

Distributed under the MIT License. See LICENSE for more information.


๐ŸŒŸ Star History

Star History Chart


๐Ÿ’ฌ Support


๐Ÿ™ Acknowledgments


๐Ÿ“ˆ Project Stats

GitHub stars GitHub forks GitHub watchers

GitHub last commit GitHub issues GitHub pull requests


Made with โค๏ธ for the DevOps community

If you find this useful, please consider giving it a โญ๏ธ

โฌ† Back to Top

About

Automated monitoring of Google's IP ranges with daily Telegram notifications and web reports.

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •