Slack + Steampipe
Slack s a messaging program designed specifically for the workplace.
Steampipe is an open source CLI to instantly query cloud APIs using SQL.
For example:
select email, is_adminfrom slack_user;
+-----------------+----------+| email| | is_admin |+-----------------+----------+| pam@dmi.com | false || creed@dmi.com | true || stanley@dmi.com | false || michael@dmi.com | true || dwight@dmi.com | false |+-----------------+----------+
Documentation
Get started
Install
Download and install the latest Slack plugin:
steampipe plugin install slack
Credentials
API tokens in Slack are associated with Apps. To use Steampipe, you need to create an App in Slack with the appropriate permissions.
- Sign in to the Slack website, and view Your Apps at https://api.slack.com/apps.
- Create New App for your workspace, e.g.,
Steampipe CLI
. - In "Add features & functionality", choose "Permissions".
- Grant permissions in a User token scope. This means the Slack App is acting on your behalf. See below for required scopes by table.
- (Re-)Install your app.
- Get the user OAuth token for your team. It looks like
xoxp-2556146250-EXAMPLE-1646968370949-df954218b5da5b8614c85cc454136b27
.
Permissions and Scopes
Scopes are used to determine the permissions and access granted to your App in Slack. Steampipe requires different permissions for each table. We recommend granting all of the scopes in the table below, but you can restrict them to specific tables if you prefer.
Table | Scope Required |
---|---|
slack_access_log | admin (paid plan required) |
slack_connection | None |
slack_conversation | channels:read , groups:read , im:read , mpim:read |
slack_emoji | emoji:read |
slack_group | usergroups:read |
slack_search | search:read |
slack_user | users:read , users:read.email |
Configuration
Installing the latest slack plugin will create a config file (~/.steampipe/config/slack.spc
) with a single connection named slack
:
connection "slack" { plugin = "slack"
# The Slack app token used to connect to the API. # Can also be set with the SLACK_TOKEN environment variable. #token = "xoxp-YOUR_TOKEN_HERE"}
Get involved
- Open source: https://github.com/turbot/steampipe-plugin-slack
- Community: Slack Channel