Table: sentry_key - Query Sentry API Keys using SQL
API Keys in Sentry are used to interact with the Sentry API on behalf of a user or an integration. They are a crucial part of the Sentry integration ecosystem, allowing for programmatic access to data and functionality within Sentry. API Keys can be associated with specific projects or be organization-wide, and can have varying levels of permissions based on their scope.
Table Usage Guide
The sentry_key
table provides insights into API Keys within Sentry. As a developer or a DevOps engineer, explore key-specific details through this table, including the name, date of creation, and associated project details. Utilize it to manage and audit your API keys, such as identifying keys with high permissions, keys that are no longer in use, or keys associated with specific projects.
Examples
Basic info
Explore which Sentry keys are active, their associated projects, and their public visibility status. This can help in managing access and maintaining security within your projects.
select id, name, is_active, secret, project_slug, publicfrom sentry_key;
select id, name, is_active, secret, project_slug, publicfrom sentry_key;
List keys for a particular project
Discover the segments that are active within a specific project by identifying the unique keys associated with it. This can be useful for managing access and understanding the overall project configuration.
select id, name, is_active, secret, project_slug, publicfrom sentry_keywhere project_slug = 'go';
select id, name, is_active, secret, project_slug, publicfrom sentry_keywhere project_slug = 'go';
List inactive keys
Discover the segments that consist of inactive keys to better manage and secure your data resources. This can help you maintain system integrity by identifying potential vulnerabilities or unused keys.
select id, name, is_active, secret, project_slug, publicfrom sentry_keywhere not is_active;
select id, name, is_active, secret, project_slug, publicfrom sentry_keywhere not is_active;
List keys older than 90 days
Discover the segments that have keys older than 90 days to assess the elements within your project that may need updating or removal for security reasons. This query is particularly useful for maintaining system security and preventing potential breaches.
select id, name, is_active, secret, project_slug, publicfrom sentry_keywhere date_created <= now() - interval '90 days';
select id, name, is_active, secret, project_slug, publicfrom sentry_keywhere date_created <= datetime('now', '-90 days');
Schema for sentry_key
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
date_created | timestamp with time zone | The creation timestamp for the key. | |
dsn | jsonb | DSN for the key. | |
id | text | The ID of the key. | |
is_active | boolean | Flag indicating the key is active. | |
label | text | The label of the key. | |
name | text | The name of the key. | |
project_id | bigint | The ID of the project the keys belongs to. | |
project_slug | text | = | The slug of the project the key belongs to. |
public | text | Public key portion of the client key. | |
rate_limit | jsonb | Represents a project key's rate limit. | |
secret | text | Secret key portion of the client key. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
title | text | Title of the resource. |
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)" -- sentry
You can pass the configuration to the command with the --config
argument:
steampipe_export_sentry --config '<your_config>' sentry_key