Use SQL to query information including Users, Groups, Clients, Roles and more from Keycloak.

Keycloak Plugin for Steampipe [WIP]

THIS IS NOT ACTIVE NOR WORKING YET - DO NOT USE

Use SQL to query information including Users, Groups, Clients, Roles and more from Keycloak.

Quick start

Install the plugin with Steampipe:

steampipe plugin install theapsgroup/keycloak

Setup the configuration:

vi ~/.steampipe/config/keycloak.spc

or set the following Environment Variables

  • KEYCLOAK_ADDR : The Endpoint at which to contact your Keycloak instance (example: https://auth.example.com/ )
  • KEYCLOAK_USER : The Username for a user with Admin privileges
  • KEYCLOAK_PASSWORD : The password for a user with Admin privileges
  • KEYCLOAK_REALM : The realm in the Keycloak instance you wish to query.

Run a query:

select * from keycloak_user

Developing

Prerequisites:

Clone:

git clone https://github.com/theapsgroup/steampipe-plugin-keycloak.git
cd steampipe-plugin-keycloak

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

make install

Configure the plugin:

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

Try it!

steampipe query
> .inspect keycloak

Further reading:

Credits

Keycloak API Wrapper Nerzal/gocloak licensed separately using this Apache License.

Owner
APS Group
APS Group is an international marketing and customer communications company, home to many blue chip clients across a range of markets.
APS Group
Comments
  • Initial plugin suggestions

    Initial plugin suggestions

    Thanks @graza-io for another great plugin! I took a look today and left some suggestions/questions below, please let me know if you have any questions on them.

    Config file:

    • Can you please change baseurl to base_url to follow the standard snake casing?

    Docs:

    • Is the brand color #FCA121 correct? It seems to be more orange, not sure if that was copy and paste from another plugin?
    • In keycloak_user.md, can you please break up the middle examples into individual examples, e.g., Get a specific user by ID, Get a specific user by username, Get a specific user by email? This allows users to copy and paste as the hub site has a copy icon per code block (in the top right of each code block).
    • Several table docs, like for keycloak_client and keycloak_group, are light on examples. Can you please add a few more so each table doc has at least 3-4 examples? These really help users get started and jump right into using your plugin.

    General:

    • Is paging supported by the API, and if so does the SDK already handle this?I took a quick look around in the SDK and didn't spot anything.
    • Does the API support passing in a limit/max number of results? For APIs that we do, we usually recommend setting that to the passed in limit clause if given and if it's lower than the default paging size or limit, e.g., https://github.com/turbot/steampipe-plugin-tfe/blob/main/tfe/table_tfe_team.go#L48-L59, as this will help reduce the number of results returned (helpful especially for large APIs).

    Tables:

    • I see a few TODOs around adding more optional key quals, like in the keycloak_user table. Are you planning on adding these before publishing the initial version?
    • Some tables seem like they don't have a lot of columns, like the keycloak_group and keycloak_user. Are there more columns we can add to both? For instance, for the keycloak_user table, in the SDK and API, it seems like there are more potential columns we can add based on what's returned by the API, but I don't see those in the table definition.
    • Possibly related to the item above, I did notice that in some tables you pass BriefRepresentation as true. Is there a reason these tables are only fetching this form of information? I only quickly read over the API docs, so I'm not very familiar with it yet, but for these tables, is it better to have the brief or full representations?
  • Recompile plugin steampipe-plugin-sdk v3.1.0 and Go version 1.18

    Recompile plugin steampipe-plugin-sdk v3.1.0 and Go version 1.18

    In this pull request, the following changes were made -

    • Recompiled the plugin with steampipe-plugin-sdk-v3.1.0

    • Recompile plugin with Go version 1.18

    • Update the plugin to support ARM64 builds

  • Docs: Missing graphics

    Docs: Missing graphics

    This repository needs the following graphics:

    /docs/keycloak.svg /docs/keycloak-plugin-social-graphic.png

    (see the GitLab one for examples, however these need to be for Keycloak).

  • Expand information available about Users in the keycloak_user table

    Expand information available about Users in the keycloak_user table

    Currently we have a minimal usage subset in this keycloak_user table, this is omitting valuable data such as:

    • Federation Link : string
    • Attributes : map[string][]string
    • RealmRoles : []string
    • Groups : []string (linkable via keycloak_user_group currently)
    • ClientRoles : map[string][]string
    • RequiredActions : []string
  • Perf: user table improvements

    Perf: user table improvements

    Currently the user table doesn't have any filters coded in which would benefit obtaining smaller data sets. This would drastically improve performance when not all users are required.

  • Docs: Tidy up all documentation at end of initial table build.

    Docs: Tidy up all documentation at end of initial table build.

    Essentially this needs to be performed after the remaining tables tagged in the milestone v0.0.1 are completed, to update all documentation and enhance it with better examples.

    This is our final checkpoint for requesting this plugin to be published, so should also ensure we remove the "WIP" mentions in the readme, etc.

Use SQL to query host, DNS and exploit information using Shodan. Open source CLI. No DB required.

Shodan Plugin for Steampipe Query Shodan with SQL Use SQL to query host, DNS and exploit information using Shodan. For example: select * from shod

Nov 10, 2022
Use SQL to instantly query instances, networks, databases, and more from Scaleway. Open source CLI. No DB required.
Use SQL to instantly query instances, networks, databases, and more from Scaleway. Open source CLI. No DB required.

Scaleway Plugin for Steampipe Use SQL to query infrastructure servers, networks, databases and more from your Scaleway project. Get started → Document

Nov 16, 2022
Use SQL to query instances, domains and more from Prometheus.
Use SQL to query instances, domains and more from Prometheus.

Use SQL to instantly query Prometheus metrics, alerts, labels and more. Open source CLI. No DB required.

Nov 28, 2022
Use SQL to instantly query resources, data sources and more from Terraform code. Open source CLI. No DB required.
Use SQL to instantly query resources, data sources and more from Terraform code. Open source CLI. No DB required.

Terraform Plugin for Steampipe Use SQL to query data from Terraform configuration files. Get started → Documentation: Table definitions & examples Com

Dec 22, 2022
Use SQL to query databases, logs and more from PlanetScale

Use SQL to instantly query PlanetScale databases, branches and more. Open source CLI. No DB required.

Sep 30, 2022
Use SQL to instantly query file, domain, URL and IP scanning results from VirusTotal.
Use SQL to instantly query file, domain, URL and IP scanning results from VirusTotal.

VirusTotal Plugin for Steampipe Use SQL to query file, domain, URL and IP scanning results from VirusTotal. Get started → Documentation: Table definit

Nov 10, 2022
Use SQL to instantly query Algolia indexes and configuration. Open source CLI. No DB required

Use SQL to instantly query Algolia indexes and configuration. Open source CLI. No DB required

Oct 1, 2022
Use SQL to instantly query Datadog resources across accounts. Open source CLI. No DB required.

steampipe-plugin-datadog Datadog Plugin for Steampipe Use SQL to query dashboards, users, roles and more from Datadog. Get started → Documentation: Ta

Dec 17, 2022
Use SQL to instantly query Hypothesis resources. Open source CLI. No DB required.

Hypothesis Plugin for Steampipe Prerequisites Steampipe Golang Build $ git clone https://github.com/judell/steampipe-plugin-hypothesis.git $ cd steam

Dec 11, 2022
This is the code example how to use SQL to query data from any relational databases in Go programming language.

Go with SQL example This is the code example how to use SQL to query data from any relational databases in Go programming language. To start, please m

Mar 12, 2022
Manage SQL databases, users and grant using kubernetes manifests

SqlOperator Operate sql databases, users and grants. This is a WIP project and should not at all be used in production at this time. Feel free to vali

Nov 28, 2021
Steampipe plugin to query your Baleen namespaces, custom rules and more

Baleen plugin for Steampipe Use SQL to query namespaces, rules and more from Baleen. Get started → Documentation: Table definitions & examples Quick s

Jun 16, 2022
Go-Postgresql-Query-Builder - A query builder for Postgresql in Go

Postgresql Query Builder for Go This query builder aims to make complex queries

Nov 17, 2022
OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.
OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.

OctoSQL OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases, streaming sources and file formats using

Dec 29, 2022
A Go SQL query builder and struct mapper.

godb - a Go query builder and struct mapper godb is a simple Go query builder and struct mapper, not a full-featured ORM. godb does not manage relatio

Dec 6, 2022
Query and Provision Cloud Infrastructure using an extensible SQL based grammar
Query and Provision Cloud Infrastructure using an extensible SQL based grammar

Deploy, Manage and Query Cloud Infrastructure using SQL [Documentation] [Developer Guide] Cloud infrastructure coding using SQL InfraQL allows you to

Oct 25, 2022
sqlbench measures and compares the execution time of one or more SQL queries.

sqlbench sqlbench measures and compares the execution time of one or more SQL queries. The main use case is benchmarking simple CPU-bound query varian

Dec 6, 2022
Run SQL queries against JSON, CSV, Excel, Parquet, and more.

Run SQL queries against JSON, CSV, Excel, Parquet, and more This is a CLI companion to DataStation (a GUI) for running SQL queries against data files.

Dec 31, 2022
Query redis with SQL
Query redis with SQL

reqlite reqlite makes it possible to query data in Redis with SQL. Queries are executed client-side with SQLite (not on the redis server). This projec

Dec 23, 2022