Skip to main content

transparent slack message anonymizer

Project description

hades

transparent slack message anonymizer

Before After
before after

[!CAUTION] This will project can apply PERMANENET CHANGES to your slack messages. Make sure to read the documentation before using it and consider testing it on a test workspace first.

Installation

Requires Python 3.12+

uv tool install hades-slack

Usage

Create Slack apps

Slack has a funny thing called ratelimiting so we need multiple apps so this doesn't take 5 and a half years to complete.

This is automated and needs an "App Configuration Token" from Slack. How do you get one?

  • Go to https://api.slack.com/apps
  • Scroll down to "Your App Configuration Tokens"
  • Click "Generate Token"
  • Copy the "Access Token" that is generated
hades create-apps APP_CONFIG_TOKEN_HERE

This will create 5 slack apps and save their credentials. (The amount can be changed with the --count flag.)

Authenticating the Slack apps

What we actually need are user tokens for each app. To get those, run:

hades install-apps

This will open a browser window for each app and ask you to authorize it. After authorizing all apps, the user tokens will be saved to apps.json.

Downloading your messages

Before any operation, you will need to make a full download of your messages. This is done with:

hades download YOUR_USER_ID_HERE --apps apps.json

This will use the apps you created to download all your messages and save them to slack_messages.db.

Use --resume to continue a previously interrupted download.

Use --purge to delete any existing messages in the database before downloading.

Seeing your message stats

Now that you have your messages downloaded, you can see some stats about them with:

hades stats

Encrypting your messages

To encrypt your messages, run:

hades encrypt YOUR_PASSWORD_HERE ENCRYPT_OLDER_THAN --apps apps.json --execute

ENCRYPT_OLDER_THAN is the amount of days old a message has to be to be encrypted. For example, 30 will encrypt all messages older than 30 days and 0 will encrypt all messages.

Removing the --execute flag will do a dry run and show you how many messages would be encrypted without actually encrypting them on Slack.

Encryption modes

Use --mode to control what replaces your message text:

  • text (default): Replace with custom text via --text (default: [anonymized with hades])
  • random: Replace with random hex string
  • invisible: Make the message invisible
  • redact: Replaces non space characters with asterisks (*)

Channel type filtering

Use --channel-type / -c to filter which types of channels to encrypt. Can be repeated for multiple types.

  • public (default): Public channels
  • private: Private channels
  • dm: Direct messages
  • gdm: Group direct messages

For example, to encrypt messages in DMs and private channels older than 30 days, run:

hades encrypt YOUR_PASSWORD_HERE 30 --apps apps.json -c dm -c private --execute

Decrypting your messages

To decrypt your messages you will need to have a fresh download of your messages (run the download command again) and then run:

hades decrypt YOUR_PASSWORD_HERE DECRYPT_YOUNGER_THAN --apps apps.json --execute

DECRYPT_YOUNGER_THAN is the amount of days old a message has to be to be decrypted. For example, 30 will decrypt all messages younger than 30 days and 0 will decrypt all messages.

Removing the --execute flag will do a dry run and show you how many messages would be decrypted without actually decrypting them on Slack.

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

hades_slack-0.1.8.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

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

hades_slack-0.1.8-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file hades_slack-0.1.8.tar.gz.

File metadata

  • Download URL: hades_slack-0.1.8.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hades_slack-0.1.8.tar.gz
Algorithm Hash digest
SHA256 9b91b9a9e01701c812724ad462aad9a46496ea46415d22ccebada9d3ff71ca54
MD5 2ad5eb93e9d256de1fa3842eb9929fe2
BLAKE2b-256 d93c19c5e5cfa92ca0d3db7787da411b8ef37157ed28fe2eb6df1c26db99920e

See more details on using hashes here.

File details

Details for the file hades_slack-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: hades_slack-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hades_slack-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 aadb04ee5876275cf8bf937fb2d56ea75cd358c1137209254f79efed73f6527f
MD5 d8b7ce04461ba8ab8bfe0e619defdf71
BLAKE2b-256 24da97d4a9aa6b4ceb1982b1b87caf7b3bb767207598ce6ef649e2157b6b704b

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