turbot/planetscale
steampipe plugin install planetscale

Table: planetscale_password - Query PlanetScale Passwords using SQL

PlanetScale is a database platform that allows developers to build applications on MySQL-compatible databases. It provides a scalable, resilient, and secure database service suitable for mission-critical applications. The PlanetScale Password resource represents the passwords associated with PlanetScale databases.

Table Usage Guide

The planetscale_password table allows users to query and analyze the passwords associated with PlanetScale databases. As a Database Administrator or Security Analyst, you can use this table to gain insights into the configuration and status of these passwords. This can assist in identifying potential security vulnerabilities, ensuring compliance with password policies, and maintaining overall database security.

Important Notes

  • You must specify the database_name in the where clause to query this table.

Examples

List all passwords for a database

Identify all passwords associated with a specific database to enhance security monitoring and ensure proper access control. This is particularly useful in managing user permissions and maintaining database integrity.

select
p.organization_name,
p.database_name,
p.branch_name,
p.name,
p.created_at
from
planetscale_password
where
database_name = 'test';
select
p.organization_name,
p.database_name,
p.branch_name,
p.name,
p.created_at
from
planetscale_password p
where
p.database_name = 'test';

List all passwords for all databases & branches

Explore which passwords are associated with specific organizations, databases, and branches. This can be beneficial for managing and reviewing access control in a real-world scenario.

select
p.organization_name,
p.database_name,
p.branch_name,
p.name,
p.created_at
from
planetscale_database as d
join planetscale_password as p on d.name = p.database_name;
select
p.organization_name,
p.database_name,
p.branch_name,
p.name,
p.created_at
from
planetscale_database as d
join planetscale_password as p on d.name = p.database_name;

List all passwords more than 90 days old

Explore which passwords in your organization's database are more than 90 days old. This can be crucial for maintaining security standards, as it allows you to identify and update potentially vulnerable or outdated passwords.

select
p.organization_name,
p.database_name,
p.branch_name,
p.name,
p.created_at
from
planetscale_database as d
join planetscale_password as p on d.name = p.database_name
where
age(p.created_at) > interval '90 days';
select
p.organization_name,
p.database_name,
p.branch_name,
p.name,
p.created_at
from
planetscale_database as d
join planetscale_password as p on d.name = p.database_name
where
julianday('now') - julianday(p.created_at) > 90;

Schema for planetscale_password

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
branch_nametext=Name of the database branch.
connection_stringsjsonbConnection strings for the branch.
created_attimestamp with time zoneWhen the password was created.
database_nametext=Name of the database.
deleted_attimestamp with time zoneWhen the password was deleted.
idtextID of the password.
nametext=Name of the password.
organization_nametext=, !=, ~~, ~~*, !~~, !~~*Name of the organization.
roletextRole for the password.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.

Export

This table is available as a standalone Exporter 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)" -- planetscale

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

steampipe_export_planetscale --config '<your_config>' planetscale_password