|
1 | | -# Steampipe Plugin — IPGeolocation.io |
| 1 | +# Steampipe Plugin for IPGeolocation.io |
2 | 2 |
|
3 | | -Query IP geolocation, network, security, timezone, company, abuse, and hostname data using SQL via the [IPGeolocation.io](https://ipgeolocation.io) v3 API. |
| 3 | +Use SQL to query IP geolocation, threat intelligence, ASN details, and abuse contacts from [IPGeolocation.io](https://ipgeolocation.io). |
| 4 | + |
| 5 | +```sql |
| 6 | +select |
| 7 | + ip, |
| 8 | + country_name, |
| 9 | + city, |
| 10 | + isp, |
| 11 | + timezone_name |
| 12 | +from |
| 13 | + ipgeolocation_ip |
| 14 | +where |
| 15 | + ip = '8.8.8.8'; |
| 16 | +``` |
4 | 17 |
|
5 | 18 | ## Quick Start |
6 | 19 |
|
7 | | -### 1. Install the plugin |
| 20 | +Install the plugin: |
8 | 21 |
|
9 | 22 | ```sh |
10 | | -steampipe plugin install ipgeolocation |
| 23 | +steampipe plugin install ipgeolocation/ipgeolocation |
11 | 24 | ``` |
12 | 25 |
|
13 | | -### 2. Configure credentials |
| 26 | +Configure your API key in `~/.steampipe/config/ipgeolocation.spc`: |
14 | 27 |
|
15 | | -```sh |
16 | | -cp config/ipgeolocation.spc ~/.steampipe/config/ipgeolocation.spc |
17 | | -# edit the file and set your api_key |
| 28 | +```hcl |
| 29 | +connection "ipgeolocation" { |
| 30 | + plugin = "ipgeolocation/ipgeolocation" |
| 31 | +
|
| 32 | + # Get your free API key at https://app.ipgeolocation.io/dashboard |
| 33 | + # Can also be set with the IPGEOLOCATION_API_KEY environment variable. |
| 34 | + # api_key = "a1b2c3d4e5f6..." |
| 35 | +} |
18 | 36 | ``` |
19 | 37 |
|
20 | | -### 3. Query away |
| 38 | +Run a query: |
21 | 39 |
|
22 | | -```sql |
23 | | --- Where is 8.8.8.8? |
24 | | -select ip, country_name, city, isp |
25 | | -from ipgeolocation_ip |
26 | | -where ip = '8.8.8.8'; |
27 | | - |
28 | | --- Is it a VPN/proxy/Tor? |
29 | | -select ip, is_vpn, is_proxy, is_tor, threat_score |
30 | | -from ipgeolocation_ip |
31 | | -where ip = '185.220.101.45'; |
| 40 | +```sh |
| 41 | +steampipe query "select ip, country_name, city from ipgeolocation_ip where ip = '8.8.8.8'" |
32 | 42 | ``` |
33 | 43 |
|
34 | | -## Requirements |
| 44 | +## Developing |
35 | 45 |
|
36 | | -| Requirement | Version | |
37 | | -|---|---| |
38 | | -| Steampipe | ≥ 0.20 | |
39 | | -| Steampipe Plugin SDK | v5 | |
40 | | -| Go | ≥ 1.21 | |
| 46 | +Prerequisites: |
41 | 47 |
|
42 | | -## Building from Source |
| 48 | +- [Steampipe](https://steampipe.io/downloads) ≥ 0.20 |
| 49 | +- [Go](https://golang.org/dl/) 1.26+ |
| 50 | + |
| 51 | +Clone the repo, build, and install: |
43 | 52 |
|
44 | 53 | ```sh |
45 | | -git clone https://github.com/turbot/steampipe-plugin-ipgeolocation |
| 54 | +git clone https://github.com/IPGeolocation/steampipe-plugin-ipgeolocation |
46 | 55 | cd steampipe-plugin-ipgeolocation |
47 | | -make |
| 56 | +make setup |
48 | 57 | ``` |
49 | 58 |
|
50 | | -## Configuration Reference |
| 59 | +`make setup` runs `go mod tidy`, builds the plugin binary, and installs both the binary and the sample config file. |
51 | 60 |
|
52 | | -```hcl |
53 | | -connection "ipgeolocation" { |
54 | | - plugin = "ipgeolocation" |
| 61 | +To rebuild after making changes: |
55 | 62 |
|
56 | | - # Required for most modules. Free tier covers basic location data. |
57 | | - # Sign up at https://app.ipgeolocation.io/ |
58 | | - api_key = "YOUR_API_KEY_HERE" |
59 | | -} |
| 63 | +```sh |
| 64 | +make install |
| 65 | +``` |
| 66 | + |
| 67 | +Run tests: |
| 68 | + |
| 69 | +```sh |
| 70 | +make test |
60 | 71 | ``` |
61 | 72 |
|
62 | | -## Tables |
| 73 | +## Documentation |
63 | 74 |
|
64 | | -| Table | Description | |
65 | | -|---|---| |
66 | | -| [ipgeolocation_ip](docs/tables/ipgeolocation_ip.md) | Geolocation data for a given IP address or domain | |
| 75 | +Full table documentation is available on [Steampipe Hub](https://hub.steampipe.io/plugins/ipgeolocation/ipgeolocation/tables) and in the [`docs/`](docs/tables) directory. |
67 | 76 |
|
68 | | -## API Plan Notes |
| 77 | +| Table | Endpoint | Description | Credits | |
| 78 | +|---|---|---|---| |
| 79 | +| [ipgeolocation_ip](docs/tables/ipgeolocation_ip.md) | `/v3/ipgeo` | Geolocation, network, timezone, security, company, abuse, hostname | 1–4 | |
| 80 | +| [ipgeolocation_security](docs/tables/ipgeolocation_security.md) | `/v3/security` | VPN, proxy, Tor, relay, bot, spam, and threat score | 2 | |
| 81 | +| [ipgeolocation_abuse](docs/tables/ipgeolocation_abuse.md) | `/v3/abuse` | Abuse contact emails, phone numbers, org, and CIDR route | 1 | |
| 82 | +| [ipgeolocation_asn](docs/tables/ipgeolocation_asn.md) | `/v3/asn` | ASN details, routes, peers, upstreams, downstreams, WHOIS | 1 | |
69 | 83 |
|
70 | | -| Module | Free | Paid | |
71 | | -|---|---|---| |
72 | | -| Location (country, city, lat/lon) | ✅ | ✅ | |
73 | | -| Timezone | ✅ | ✅ | |
74 | | -| Network / ASN | ✅ | ✅ | |
75 | | -| Hostname | ❌ | ✅ | |
76 | | -| Security (VPN, proxy, threat score) | ❌ | ✅ | |
77 | | -| Company | ❌ | ✅ | |
78 | | -| Abuse contact | ❌ | ✅ | |
| 84 | +## License |
79 | 85 |
|
80 | | -Free-plan columns will return `null` when the field is not available on your subscription tier. |
| 86 | +This plugin is licensed under the [Apache 2.0 License](LICENSE). |
0 commit comments