Skip to content

Instantly share code, notes, and snippets.

@judell
judell / cody-steampipe-04.md
Created May 27, 2023 19:32
cody-steampipe-04

Me: paste context from https://jreyesr.github.io/posts/steampipe-part-int-pi-mods/

Me

given this context, how would i add a slider widget?

Cody Adding a slider widget to Steampipe dashboards would be a useful feature. Here is how I would approach implementing it:

Define the slider widget in the Steampipe dashboard DSL. It could look something like this:

@judell
judell / cody-steampipe-03.md
Created May 27, 2023 19:17
cody-steampipe-03

Me

which parts of the code should i explore to learn how to make a new echarts widget, say a slider, available as an HCL component that runs SQL and feeds data into the echarts slider?

Cody

Read 13 files To add a new ECharts widget (like a slider) as an HCL component that runs SQL, you should explore the following parts of the code:

ui/dashboard/src/components/dashboards/charts/echarts.ts - This file registers all the ECharts chart types that Steampipe supports. You'll need to import the ECharts slider component here and add it to the echarts.use() call.

@judell
judell / cody-steampipe-02.md
Created May 27, 2023 19:13
cody-steampipe-02

Me

"The dashboard server executes each SQL query and caches the results."

That's wrong. The Steampipe CLI runs the query and passes results to the dashboard server

Cody

Read 12 files You're right, my previous statement was incorrect. The correct explanation is:

@judell
judell / cody-steampipe-01.md
Created May 27, 2023 19:11
cody-steampipe-01

Me how does the dashboard server receive the results of sql queries and render them as tables and charts?

Cody

Read 13 files The Steampipe dashboard server receives SQL query results and renders them as tables and charts in the following way:

When a dashboard is loaded, the dashboard server parses the dashboard definition file (dashboard.sp). This includes parsing any SQL queries defined in the dashboard.

@judell
judell / extending-waf.md
Last active May 23, 2023 20:31
extending-waf

The initial release of the AWS Well-Architected mod supported two of the six pillars of the AWS Well-Architected Framework: Reliability and Security. In this post we'll show how you can extend the Well-Architected mod with a benchmark that helps you assess your infrastructure in terms of the enviromental impacts targeted by the Sustainability pillar.

Well-Architected is itself an example of how to Reuse and remix existing benchmarks and dashboards: it reuses controls from AWS Compliance. The Sustainability

@judell
judell / masto-test.py
Last active May 7, 2023 06:30
masto-test.py
from mastodon import Mastodon #You need to install mastodonpy for python3.
import os
import logging
logging.basicConfig(level=logging.DEBUG)
mastodon = Mastodon(
access_token='***',
api_base_url='https://social.coop'
#access_token='***',
@judell
judell / update-home-timeline.sql
Created May 3, 2023 17:09
update-home-timeline
with data as (
select
account,
account_url,
content,
created_at,
display_name,
followers,
following,
id,
@judell
judell / save-query-results-for-analysis.md
Last active April 27, 2023 21:49
save query results for analysis

How to save Steampipe outputs for analysis

Steampipe queries persist in cache for a default 5 minutes. You can increase the TTL to keep results in cache longer, but sometimes you'll want to save query results for later analysis.

Here are some common scenarios.

I want to analyze the results of a CIS 1.5 control or benchmark

You can use steampipe check with the --export flag to capture a CSV representation of the data that powers an individual control, or a suite of controls packaged as a benchmark.

@judell
judell / javier-2.sp
Last active April 14, 2023 18:06
javier-2
dashboard "javier" {
with "tls_connection" {
sql = <<EOQ
create or replace function public.tls_connection(domain text) returns setof net_tls_connection as $$
select
*
from
net_tls_connection
where
@judell
judell / javier.sp
Last active April 13, 2023 22:37
dashboard with code reuse
dashboard "javier" {
with "tls_data" {
sql = <<EOQ
select
'domain.com:443' as address,
max(distinct version) as max_version
from
net_tls_connection
where