steampipe plugin install hibp

Have I Been Pwned + Steampipe

Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.

Have I Been Pwned (HIBP) is an online searchable index of data breaches where anyone can quickly assess if they may have been put at risk due to an online account of theirs having been compromised or "pwned" in a data breach.

For example:

select
name,
pwn_count as compromised_count,
is_verified as verified,
breach_date
from
hibp_breach
where
breach_date > '2022-01-01';
+----------------+-------------------+----------+---------------------------+
| name | compromised_count | verified | breach_date |
+----------------+-------------------+----------+---------------------------+
| AmartFurniture | 108940 | true | 2022-05-16T05:30:00+05:30 |
| BlackBerryFans | 174168 | true | 2022-05-06T05:30:00+05:30 |
| Fanpass | 112251 | true | 2022-04-30T05:30:00+05:30 |
| GiveSendGo | 89966 | true | 2022-02-07T05:30:00+05:30 |
| CDEK | 19218203 | false | 2022-03-09T05:30:00+05:30 |
| Doxbin | 370794 | true | 2022-01-05T05:30:00+05:30 |
| NVIDIA | 71335 | true | 2022-02-23T05:30:00+05:30 |
| MacGeneration | 101004 | true | 2022-01-29T05:30:00+05:30 |
| PayHere | 1580249 | true | 2022-03-27T05:30:00+05:30 |
+----------------+-------------------+----------+---------------------------+

Documentation

Get started

Install

Download and install the latest HIBP plugin:

steampipe plugin install hibp

Configuration

Installing the latest hibp plugin will create a config file (~/.steampipe/config/hibp.spc) with a single connection named hibp:

connection "hibp" {
plugin = "hibp"
# `api_key` - The API key to access the HIBP API.
# This is only required while querying `hibp_breached_account` and `hibp_paste` tables.
# This can also be set with the 'HIBP_API_KEY' environment variable
# See https://haveibeenpwned.com/API/Key for more information on how to generate one
# api_key = "03ef6bfxxxxxxxxxxxxxxx8ad568286b"
}
  • api_key - The API key to access the HIBP API. Can also be set with the HIBP_API_KEY environment variable. This is only required while querying hibp_breached_account and hibp_paste tables.

Postgres FDW

This plugin is available as a native Postgres FDW. Unlike Steampipe CLI, which ships with an embedded Postgres server instance, the Postgres FDW can be installed in any supported Postgres database version.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_postgres_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" -- hibp

The installer will prompt you for the plugin name and version, download and install the appropriate files for your OS, system architecture, and Postgres version.

To configure the Postgres FDW, you will create an extension, foreign server, and schema and import the foreign schema.

CREATE EXTENSION IF NOT EXISTS steampipe_postgres_hibp;
CREATE SERVER steampipe_hibp FOREIGN DATA WRAPPER steampipe_postgres_hibp OPTIONS (config '<your_config>');
CREATE SCHEMA hibp;
IMPORT FOREIGN SCHEMA hibp FROM SERVER steampipe_hibp INTO hibp;

SQLite Extension

This plugin is available as a SQLite Extension, making the tables available as SQLite virtual tables.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_sqlite_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/sqlite.sh)" -- hibp

The installer will prompt you for the plugin name, version, and destination directory. It will then determine the OS and system architecture, and it will download and install the appropriate package.

To configure the SQLite extension, load the extension module and then run the steampipe_configure_hibp function to configure it with plugin-specific options.

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_hibp.so
sqlite> select steampipe_configure_hibp('<your_config>');

Export

This plugin is available as a standalone Export CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- hibp

You can pass the configuration to the command with the --config argument:

steampipe_export_hibp --config '<your_config>' <table_name>