Git Product home page Git Product logo

turbot / steampipe-plugin-ipstack Goto Github PK

View Code? Open in Web Editor NEW
8.0 10.0 2.0 397 KB

Use SQL to instantly query IP geolocation and more from ipstack. Open source CLI. No DB required.

Home Page: https://hub.steampipe.io/plugins/turbot/ipstack

License: Apache License 2.0

Makefile 1.03% Go 93.14% PLSQL 5.83%
ipstack steampipe steampipe-plugin postgresql postgresql-fdw sql hacktoberfest backup etl sqlite

steampipe-plugin-ipstack's Introduction

image

ipstack Plugin for Steampipe

Use SQL to query IP address information including geolocation and more from ipstack.

Quick start

Install the plugin with Steampipe:

steampipe plugin install ipstack

Run a query:

select
  ip,
  country_code,
  region_name,
  latitude
from
  ipstack_ip
where
  ip = '99.84.45.75';
> select ip, country_code, region_name, latitude from ipstack_ip where ip = '99.84.45.75' ;
+-------------+--------------+-------------+--------------------+
| ip          | country_code | region_name | latitude           |
+-------------+--------------+-------------+--------------------+
| 99.84.45.75 | US           | New Jersey  | 40.738731384277344 |
+-------------+--------------+-------------+--------------------+

Engines

This plugin is available for the following engines:

Engine Description
Steampipe The Steampipe CLI exposes APIs and services as a high-performance relational database, giving you the ability to write SQL-based queries to explore dynamic data. Mods extend Steampipe's capabilities with dashboards, reports, and controls built with simple HCL. The Steampipe CLI is a turnkey solution that includes its own Postgres database, plugin management, and mod support.
Postgres FDW Steampipe Postgres FDWs are native Postgres Foreign Data Wrappers that translate APIs to foreign tables. Unlike Steampipe CLI, which ships with its own Postgres server instance, the Steampipe Postgres FDWs can be installed in any supported Postgres database version.
SQLite Extension Steampipe SQLite Extensions provide SQLite virtual tables that translate your queries into API calls, transparently fetching information from your API or service as you request it.
Export Steampipe Plugin Exporters provide a flexible mechanism for exporting information from cloud services and APIs. Each exporter is a stand-alone binary that allows you to extract data using Steampipe plugins without a database.
Turbot Pipes Turbot Pipes is the only intelligence, automation & security platform built specifically for DevOps. Pipes provide hosted Steampipe database instances, shared dashboards, snapshots, and more.

Developing

Prerequisites:

Clone:

git clone https://github.com/turbot/steampipe-plugin-ipstack.git
cd steampipe-plugin-ipstack

Build, which automatically installs the new version to your ~/.steampipe/plugins directory:

make

Configure the plugin:

cp config/* ~/.steampipe/config
vi ~/.steampipe/config/ipstack.spc

Try it!

steampipe query
> .inspect ipstack

Further reading:

Open Source & Contributing

This repository is published under the Apache 2.0 (source code) and CC BY-NC-ND (docs) licenses. Please see our code of conduct. We look forward to collaborating with you!

Steampipe is a product produced from this open source software, exclusively by Turbot HQ, Inc. It is distributed under our commercial terms. Others are allowed to make their own distribution of the software, but cannot use any of the Turbot trademarks, cloud services, etc. You can learn more in our Open Source FAQ.

Get Involved

Join #steampipe on Slack →

Want to help but don't know where to start? Pick up one of the help wanted issues:

steampipe-plugin-ipstack's People

Contributors

bigdatasourav avatar cbruno10 avatar dependabot[bot] avatar e-gineer avatar johnsmyth avatar lalitlab avatar misraved avatar rajeshbal65 avatar rupeshpatil20 avatar subhajit97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

baganda07

steampipe-plugin-ipstack's Issues

Revalidate the IPstack API documentation to use the latest authentication attributes

Is your feature request related to a problem? Please describe.
N/A

Describe the solution you'd like
The IPstack plugin currently utilizes an outdated Go SDK, which has some mismatch in the authentication attributes with the latest IPstack API authentication methods as outlined in the official IPstack API documentation.

Describe alternatives you've considered

  • Review the latest IPstack API documentation.
  • Identify changes required in the plugin's codebase to accommodate the new authentication method.
  • Test the updated plugin against the current IPstack API to ensure functionality.

Additional context
Add any other context or screenshots about the feature request here.

Security data requires a subscription, make it optional (default false)

Security data has always required a subscription, but used to work without error anyway:

// Security requires a subscription, but doesn't fail, so leave it on
ipstack.ParamEnableSecurity(true),

That would now cause this error:

~/src/steampipe $ steampipe --version
steampipe version 0.12.2
~/src/steampipe $ steampipe plugin list | grep ipstack
| hub.steampipe.io/plugins/turbot/ipstack@latest    | 0.4.0   | ipstack     |
~/src/steampipe $ 
~/src/steampipe $ steampipe query
Welcome to Steampipe v0.12.2
For more information, type .help
> select * from ipstack_ip where ip = '8.8.8.8'
Error: [105]: function_access_restricted (The current subscription plan does not support this API endpoint.) (SQLSTATE HV000)
> 

So, we need to add an option called security (default false). This will prevent failure (returning null in columns), but allow subscribers to get full value.

joining `ipstack_ip` on `ip` does not work

This always returns no results:

> select * from aws_vpc_eip, ipstack_ip where ip=public_ip
+---------------+-----------+------------------+--------+----------------+------------+-------------------+--------------------------+-------------+----------------------+----------------------+--------------
| allocation_id | public_ip | public_ipv4_pool | domain | association_id | carrier_ip | customer_owned_ip | customer_owned_ipv4_pool | instance_id | network_border_group | network_interface_id | network_inter
+---------------+-----------+------------------+--------+----------------+------------+-------------------+--------------------------+-------------+----------------------+----------------------+--------------
+---------------+-----------+------------------+--------+----------------+------------+-------------------+--------------------------+-------------+----------------------+----------------------+--------------

> select public_ip from aws_vpc_eip
+-------------+
| public_ip   |
+-------------+
| 3.232.92.18 |
+-------------+
> 

This is due to SDK iss turbot/steampipe-postgres-fdw#3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.