IP Geolocation for Steampipe: Enrich Your Log IPs with SQL
Join location, network owner, VPN, proxy, Tor, and threat data to the IP columns in your AWS CloudTrail, VPC flow log, and Microsoft Entra ID tables, in one SQL query.
Why Run IP Lookups Inside Steampipe
Steampipe turns cloud APIs and logs into SQL tables, and many of those tables already hold IP addresses: source_ip_address in CloudTrail events, src_addr in VPC flow logs, and ip_address in Microsoft Entra ID sign-ins.
The IPGeolocation.io plugin adds four tables keyed by IP. Join one of them on that column and every row gains its country, network owner, and VPN, proxy, Tor, and threat-score signals, fetched live at query time. The same tables run in the Steampipe CLI, in any Postgres through the foreign data wrapper, and in SQLite.
select ip, is_tor, is_vpn, threat_score
from ipgeolocation_security
where ip = '185.220.101.1';+---------------+--------+--------+--------------+
| ip | is_tor | is_vpn | threat_score |
+---------------+--------+--------+--------------+
| 185.220.101.1 | true | false | 95 |
+---------------+--------+--------+--------------+Join IP Data With Your Other Steampipe Plugins
Install the AWS or Azure AD plugin alongside this one and enrich the IP addresses they return. Each query groups rows to distinct IPs first, so every address is looked up once.
Console sign-ins from VPN or Tor addresses
Find the past week's ConsoleLogin events that came through a VPN or Tor, or from an address with a high threat score. The AWS table needs your CloudTrail log group name, and the security columns need a paid plan.
with console_logins as (
select source_ip_address as ip, count(*) as logins,
string_agg(distinct username, ', ') as users
from aws_cloudtrail_trail_event
where log_group_name = 'aws-cloudtrail-logs'
and timestamp >= now() - interval '7 days'
and event_name = 'ConsoleLogin'
group by source_ip_address
)
select c.ip, c.users, c.logins, g.country_name, g.is_vpn, g.is_tor, g.threat_score
from console_logins c
join ipgeolocation_ip g on g.ip = c.ip
where g.is_vpn or g.is_tor or g.threat_score >= 45
order by g.threat_score desc;+---------------+-------------+--------+---------------+--------+--------+--------------+
| ip | users | logins | country_name | is_vpn | is_tor | threat_score |
+---------------+-------------+--------+---------------+--------+--------+--------------+
| 185.220.101.1 | dana.k | 3 | Germany | false | true | 95 |
| 2.56.188.34 | build-admin | 1 | United States | true | false | 80 |
+---------------+-------------+--------+---------------+--------+--------+--------------+Who your security groups are rejecting
Rank yesterday's rejected source addresses and see the country and network behind each one. src_addr is an inet column, so host() turns it into the plain address text the plugin expects.
with rejected as (
select host(src_addr) as ip, count(*) as attempts
from aws_vpc_flow_log_event
where log_group_name = 'vpc-flow-logs'
and timestamp >= now() - interval '1 day'
and action = 'REJECT'
group by src_addr
order by attempts desc
limit 10
)
select r.ip, r.attempts, g.country_name, g.asn, g.organization
from rejected r
join ipgeolocation_ip g on g.ip = r.ip
order by r.attempts desc;+----------------+----------+---------------+---------+---------------------------+
| ip | attempts | country_name | asn | organization |
+----------------+----------+---------------+---------+---------------------------+
| 45.142.212.100 | 1840 | Poland | AS48031 | Ivanov Vitaliy Sergeevich |
| 198.98.54.11 | 912 | United States | AS53667 | FranTech Solutions |
| 162.247.72.199 | 365 | United States | AS4224 | The Calyx Institute |
+----------------+----------+---------------+---------+---------------------------+Sign-ins through VPNs, proxies, or Tor
Check the last day of Entra ID sign-ins for anonymized connections. When you only need risk signals, ipgeolocation_security costs 2 credits per IP instead of 4. It needs a paid plan.
with sign_ins as (
select ip_address as ip, count(*) as sign_ins,
count(distinct user_principal_name) as users
from azuread_sign_in_report
where created_date_time >= now() - interval '1 day'
group by ip_address
)
select si.ip, si.users, si.sign_ins, s.is_vpn, s.is_proxy, s.is_tor, s.threat_score
from sign_ins si
join ipgeolocation_security s on s.ip = si.ip
where s.is_vpn or s.is_proxy or s.is_tor
order by s.threat_score desc;+---------------+-------+----------+--------+----------+--------+--------------+
| ip | users | sign_ins | is_vpn | is_proxy | is_tor | threat_score |
+---------------+-------+----------+--------+----------+--------+--------------+
| 2.56.188.34 | 2 | 6 | true | false | false | 80 |
| 185.220.101.1 | 1 | 4 | false | false | true | 95 |
+---------------+-------+----------+--------+----------+--------+--------------+Sample output: user names and counts are made up, and the IP data comes from live lookups on November 17, 2026. Log group names are examples; use your own.
Four Tables, One Plugin
Every table takes an IP in the WHERE clause or a join, and returns it as a row. The plugin documentation lists every column.
| Table | Returns | Credits | Plan |
|---|---|---|---|
ipgeolocation_ip | Location, time zone, ASN and organization, and company, plus the security and abuse fields on paid plans, in one row | 4 per IP on paid plans, 1 on Free | Free and paid |
ipgeolocation_security | VPN, proxy, Tor, relay, bot, spam, attacker, and cloud-provider flags with a 0 to 100 threat score | 2 per IP | Paid |
ipgeolocation_abuse | The registered abuse contact (name, emails, phone numbers, postal address) and CIDR route for an IP address, when contact data is available | 1 per IP that returns abuse contact data | Paid |
ipgeolocation_asn | ASN, organization, type, RIR, and route counts, looked up by IP or AS number | 1 per lookup | Paid |
Query IP Geolocation in Three Steps
You go from install to a working query in a couple of minutes. No credit card required to start.
Install the plugin
Run the Steampipe install command for the IPGeolocation.io plugin. Steampipe pulls the binary for you, with no build step.
Add your API key
Paste your key into the plugin's .spc config file, or set the IPGEOLOCATION_API_KEY environment variable.
Run a query
SELECT from any of the four tables with an IP in the WHERE clause, and the plugin returns it as a SQL row you can join and filter.
Install the plugin
Run the Steampipe install command for the IPGeolocation.io plugin. Steampipe pulls the binary for you, with no build step.
Start free and run your first queryAdd your API key
Paste your key into the plugin's .spc config file, or set the IPGEOLOCATION_API_KEY environment variable.
Run a query
SELECT from any of the four tables with an IP in the WHERE clause, and the plugin returns it as a SQL row you can join and filter.
The full setup, including the Postgres and SQLite options, lives in the plugin documentation.
Who Uses It
Teams that already query their cloud and identity data in Steampipe add IP context to the same queries.
Flag CloudTrail console sign-ins that come through a VPN or Tor, or from a country your team never works from, and save the query as a scheduled check.
Cloud Security Teams Watching AWS Sign-ins
Flag CloudTrail console sign-ins that come through a VPN or Tor, or from a country your team never works from, and save the query as a scheduled check.
SOC Analysts Triaging Risky Sign-ins
Check which Microsoft Entra ID sign-ins used a VPN, proxy, or Tor, and pull the abuse contact for an address that needs reporting, in the same SQL session.
DevOps and SRE Teams Reviewing Rejected Traffic
See the countries and networks behind the traffic your VPC security groups reject, to tell scanners from a misconfigured partner.
Compliance and Audit Teams Documenting Access
Map sign-in IPs to country and network owner for an access review or a data-residency check, and export the query result as evidence.
Why IPGeolocation.io + Steampipe
Steampipe runs SQL against live APIs as if they were database tables. The IPGeolocation.io plugin turns IP geolocation, threat, ASN, and abuse data into four tables you can filter, join, and aggregate with the SQL you already write.
Four Tables, Live Data
Geolocation, security, abuse, and ASN data, fetched live from the API at query time rather than from a cached snapshot.
Geolocation without a pipeline
Resolve any IPv4 or IPv6 address to a location in one SELECT. No scripts, no JSON parsing, no pagination.
Runs Beyond the CLI
The same tables run in the Steampipe CLI, in any Postgres through the foreign data wrapper, and in SQLite.
Free and Open Source
The plugin is Apache 2.0 licensed and runs on the free plan, with 1,000 credits per day for geolocation, time zone, and basic ASN data. Full ASN details like routes, peers, and WHOIS are on paid plans.
Trusted by thousands of companies around the world
Steampipe Integration FAQs
The plugin is free and open source under Apache 2.0. It runs on the IPGeolocation.io free plan, which includes 1,000 credits per day covering geolocation, time zone, and basic ASN data. Security signals, company data, detailed ASN and abuse contacts are available on paid plans.
Yes. With the AWS or Azure AD plugin installed alongside this one, join on the IP column those tables already have: source_ip_address in aws_cloudtrail_trail_event, host(src_addr) in aws_vpc_flow_log_event, and ip_address in azuread_sign_in_report. The two AWS tables also need your log group name in the WHERE clause. Group the rows to distinct IPs first so each address is looked up only once.
For a list of IPs, credits are charged per valid IP, only on success. Group your rows to distinct IPs before the join, so each address is looked up once. The ipgeolocation_ip table requests include=*. A successful lookup costs 4 credits on a paid plan and 1 credit on Free. On a paid plan, ipgeolocation_security costs 2 credits per successful lookup, and ipgeolocation_abuse costs 1 per IP that returns abuse contact data. Selecting fewer columns does not reduce the charge (see the credits usage guide). For large or recurring enrichment, the downloadable IP databases query locally with no per-lookup cost. For very high volume, talk to us.
No. After installing the plugin and adding your API key, you work entirely in SQL, the same SELECT and JOIN you already write. The Steampipe Hub also ships 22 example queries you can copy and adapt for your own data.
Four tables. ipgeolocation_ip returns full enrichment, ipgeolocation_security returns VPN, proxy, Tor, and threat scores, ipgeolocation_abuse returns abuse contacts, and ipgeolocation_asn returns network and routing data. Each takes an IP address in the WHERE clause and returns it as a SQL row.
Yes. Every table accepts both IPv4 and IPv6 addresses in the WHERE clause and returns the same columns for each address type. You can mix address types across queries without changing anything. IPv6 works on every plan, including the free plan, with no separate configuration or endpoint.
Results come live from the IPGeolocation.io API at query time, not from a cached snapshot, and the underlying data is updated daily, fed by collection that runs 24/7. Read how our IP geolocation data is built for the full pipeline. On paid plans, each row also includes confidence and accuracy_radius fields, so you can filter results by how precise a location is.
Integration with Your Favorite Apps
Unlock the potential of seamless connectivity with our integrations. Discover how our platform effortlessly connects with your favorite tools, third-party platforms, and developer libraries. Simplify your workflow, boost productivity, and open doors to new innovations.