n8n Google Sheets IP Geolocation Security

IP geolocation & HTTP port scanning with Google Sheets

Automate security analysis by enriching IP addresses with geolocation data and scanning open ports

Download Template JSON · n8n compatible · Free
IP geolocation workflow interface in n8n

What This Workflow Does

This n8n workflow automates the process of enriching IP addresses with geolocation data and scanning for open HTTP ports. It's designed for security teams, IT administrators, and network analysts who need to quickly analyze IP addresses from various sources.

The workflow triggers whenever new IP addresses are added to a Google Sheet, then automatically looks up geolocation details (country, city, ISP) and scans for open HTTP ports (80, 443). The enriched data is then written back to your spreadsheet, creating a comprehensive security analysis dashboard.

How It Works

1. Google Sheets Trigger

The workflow monitors a specific Google Sheet for new IP address entries. When a new row is added, the workflow automatically processes the IP data.

2. IP Geolocation Lookup

Each IP address is sent to a geolocation API (like IPAPI or IP2Location) to retrieve detailed location information including country, city, region, ISP, and coordinates.

3. Port Scanning

The workflow then checks common HTTP ports (80 and 443) to determine if they're open, helping identify potential web services running on the IP.

4. Data Enrichment

All gathered information is combined and written back to your Google Sheet, creating a complete security profile for each IP address.

Who This Is For

This automation is ideal for:

  • Security teams monitoring suspicious IP activity
  • IT administrators tracking network access attempts
  • Fraud prevention teams analyzing transaction origins
  • Network analysts investigating traffic patterns
  • DevOps engineers automating security workflows

Pro tip: Combine this with your SIEM system to automatically flag IPs from high-risk locations or with unexpected open ports.

What You'll Need

  1. An n8n instance (cloud or self-hosted)
  2. A Google Sheet with IP addresses to analyze
  3. Google Cloud credentials with Sheets API access
  4. A geolocation API key (free tiers available from most providers)

Quick Setup Guide

  1. Download the template file
  2. Import into your n8n instance
  3. Connect your Google Sheets account
  4. Configure your geolocation API credentials
  5. Set the sheet ID and range to monitor
  6. Activate the workflow

Key Benefits

Save hours of manual investigation by automating IP analysis that would normally require multiple tools and copy-pasting between systems.

Improve security response times with real-time enrichment of IP data as soon as it's logged in your systems.

Centralize security intelligence by bringing geolocation and port scanning data directly into your existing Google Sheets workflows.

Scale your analysis capabilities to handle hundreds of IPs simultaneously without additional manual effort.

Create audit-ready records with automatically timestamped and documented IP investigations.

Frequently Asked Questions

Common questions about IP geolocation and security automation

IP geolocation identifies the physical location of an internet-connected device based on its IP address. For security teams, this helps detect suspicious activity patterns, verify user locations, and identify potential threats originating from high-risk regions.

For example, if your authentication logs show login attempts from IPs geolocated to countries where you don't operate, this could indicate credential stuffing attacks. Geolocation adds crucial context to raw IP data that helps prioritize security responses.

  • Helps detect VPN/Tor exit nodes
  • Identifies geographically impossible travel
  • Supports compliance with regional data regulations

IP geolocation accuracy varies by provider and IP type. Typically, you can expect city-level accuracy for about 85-90% of IPs, with country-level accuracy near 99%. Mobile IPs tend to be less precise than business or residential IPs.

Most commercial geolocation services update their databases monthly. For security use cases, the approximate location is often sufficient to identify suspicious patterns, though it shouldn't be used as sole proof of location.

  • Combine with other signals for higher confidence
  • Consider using multiple geolocation providers
  • Account for VPN/proxy services in your analysis

Open HTTP ports (80, 443) on unexpected IPs can signal misconfigured services, unauthorized systems, or potential malware command-and-control servers. While these ports are normally open on web servers, finding them on employee devices or non-web infrastructure warrants investigation.

For instance, an internal IP with suddenly open port 443 might indicate an employee running an unauthorized web service, or worse, a compromised system communicating with attackers. Automated scanning helps surface these anomalies quickly.

  • Port scanning complements firewall logs
  • Helps identify shadow IT systems
  • Can detect ransomware callback channels

The frequency depends on your risk profile and log volume. High-security environments might scan all new IPs in real-time, while others may batch process logs daily. Critical systems should be monitored continuously.

A practical approach is real-time scanning for privileged access attempts and authentication failures, with daily batches for lower-risk events. This balances responsiveness with resource usage. Automated workflows like this template make frequent scanning practical.

  • Prioritize scanning based on event severity
  • Consider API rate limits when planning frequency
  • Adjust frequency based on false positive rates

Yes, IP geolocation can support GDPR compliance by helping identify when EU personal data might be processed outside approved regions. While IPs alone aren't always personal data, they can indicate data flows that require documentation under GDPR.

For example, if your web analytics show EU visitor traffic being processed by US servers, geolocation helps flag this for compliance review. Automated workflows can generate the necessary documentation for data protection impact assessments.

  • Helps map international data flows
  • Supports Schrems II compliance efforts
  • Can trigger geo-based access restrictions

Active scanning sends network packets to check port status, while passive scanning analyzes existing traffic logs. Active scanning provides current status but may trigger security alerts, while passive scanning is stealthier but only shows recently used ports.

This workflow uses active scanning for accuracy. For sensitive environments, you might modify it to analyze firewall logs instead. The choice depends on whether you need real-time detection or historical analysis.

  • Active: More accurate but detectable
  • Passive: Stealthier but incomplete
  • Consider hybrid approaches for balance

Absolutely! GrowwStacks specializes in building tailored security automations that integrate with your existing tools and workflows. While this template provides basic IP analysis, we can create custom solutions that match your specific security requirements.

Our team can build workflows that connect to your SIEM, ticketing systems, or threat intelligence platforms. We implement additional checks like reputation scoring, historical pattern analysis, and automated response actions based on your risk thresholds.

  • Integrates with your security stack
  • Custom risk scoring algorithms
  • Automated response workflows

Need a Custom IP Security Automation?

This free template is a starting point. Our team builds fully tailored automation systems for your specific needs.