Skip to main content

Monitoring your Slack workspaces for sensitive information

Project description

Slack Watchman

Python 2.7 and 3 compatible PyPI version License: MIT

Monitoring your Slack workspaces for sensitive information

About Slack Watchman

Slack Watchman is an application that uses the Slack API to look for potentially sensitive data exposed in your Slack workspaces.

More information about Slack Watchman can be found on my blog.

Features

Slack Watchman searches for, and reports back on:

  • Externally shared channels
  • Potential leaked passwords
  • AWS keys
  • GCP keys
  • Google API keys
  • Slack API keys & webhooks
  • Twitter API keys
    • Access token
    • oauth_token
    • oauth_token_secret
  • Facebook API Keys
    • Access token
    • Secret keys
  • Private keys
  • Paypal Braintree tokens
  • Bank card details
  • Certificate files
  • Potentially interesting/malicious files (.docm, .xlsm, .zip etc.)
  • Passport numbers
  • Dates of birth

It also gives the following, which can be used for general auditing:

  • All channels
  • All users
  • All admins

Time based searching

You can run Slack Watchman to look for results going back as far as:

  • 24 hours
  • 7 days
  • 30 days
  • All time

This means after one deep scan, you can schedule Slack Watchman to run regularly and only return results from your chosen timeframe.

Requirements

Slack API token

To run Slack Watchman, you will need a Slack API OAuth access token. You can do this by creating a simple Slack App.

The app needs to have the following User Token Scopes added:

channels:read
files:read
groups:read
im:read
links:read
mpim:read
remote_files:read
search:read
team:read
users:read
users:read.email

Note: User tokens act on behalf of the user who authorises them, so I would suggest you create this app and authorise it using a service account, otherwise the app will have access to your private channels and chats.

Providing token

Slack Watchman will first try to get the the Slack token from the environment variable SLACK_WATCHMAN_TOKEN, if this fails it will load the token from .conf file (see below).

.conf file

This API token needs to be stored in a file named watchman.conf which is stored in your home directory. The file should take the following format:

[auth]
slack_token = xoxp-xxxxxxxxxx-...

Slack Watchman will look for this file at runtime, and notify you if it's not there.

Installation

Install via pip

pip install slack-watchman

Usage

Slack Watchman will be installed as a global command, use as follows:

usage: slack-watchman [-h] --timeframe {d,w,m,a} [--version] [--all] [-U] [-C]
                   [-a] [-g] [-G] [-s] [-p] [-c] [-b] [-t] [-f] [-P] [-d]
                   [-pn] [-tw]

Monitoring your Slack workspaces for sensitive information

optional arguments:
  -h, --help            show this help message and exit
  --timeframe {d,w,m,a}
                        How far back to search: d = 24 hours w = 7 days, m =
                        30 days, a = all time
  --version             show program's version number and exit
  --all                 Find everything
  -U, --users           Find all users, including admins
  -C, --channels        Find all channels, including external shared channels
  -a                    Look for AWS keys
  -g                    Look for GCP keys
  -G                    Look for Google API keys
  -s                    Look for Slack tokens
  -p                    Look for private keys
  -c                    Look for card details
  -b                    Look for PayPal Braintree details
  -t                    Look for certificate files
  -f                    Look for interesting files
  -P                    Look for passwords
  -d                    Look for dates of birth
  -pn                   Look for passport numbers
  -tw                   Look for Twitter keys
  -fb                   Look for Facebook secret keys and access tokens

You can run Slack Watchman to look for everything:

slack-watchman --timeframe a --all

Or arguments can be grouped together to search more granularly. This will look for AWS keys, GCP keys and passwords for the last 30 days:

slack-watchman --timeframe m -agP

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slack-watchman-1.6.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slack_watchman-1.6.0-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file slack-watchman-1.6.0.tar.gz.

File metadata

  • Download URL: slack-watchman-1.6.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for slack-watchman-1.6.0.tar.gz
Algorithm Hash digest
SHA256 92aabb4b47e633bee0d98a7da72d48e540bc24a099d6d3ecdb022aa9cad107b8
MD5 c1db204ce32f417f90f07ba08b1827c4
BLAKE2b-256 5e6f7cf19091d2a789c59fd26eeeaccaae934e6965aad6e492a77c4bc1f7c6df

See more details on using hashes here.

File details

Details for the file slack_watchman-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: slack_watchman-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for slack_watchman-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7db35cab38a2b9327d189c2231ceed65910feac5cc9429faab854678949f1d73
MD5 778f8f8abd45d05e73c9a6ae4e761af0
BLAKE2b-256 c6485a2e348f0057c99d28676cffa5f5fae78d1dc8fb1e43fe4f955942dda56f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page