SafeChat Slack Bot is an open-source project designed to enhance data security within Slack workspaces.
Readme em Português - PTBR.
SafeChat Slack Bot is an open-source project designed to enhance data security within Slack workspaces. The bot's primary objective is to provide real-time alerts to users when sensitive information such as CPF (Brazilian taxpayer registry identification), email addresses, and other personally identifiable information (PII) are shared within Slack channels. SafeChat Slack Bot identifies and notifies users about potential data breaches, promoting a safer and more secure communication environment within Slack.
The SafeChat must be a member to receive messages from a channel or dm.
Before you can run the app, you'll need to store some environment variables.
Please pay attention on pre-requisites resources that you must install/configure.
Variable | Description | Available Values | Default Value | Required |
---|---|---|---|---|
ENV | The application enviroment | dev / test / qa / prod |
dev |
Yes |
PYTHONPATH | Provides guidance to the Python interpreter about where to find libraries and applications | ref | . |
Yes |
LANGUAGE | The bot language | en / pt_BR |
pt_BR |
Yes |
SLACK_BOT_TOKEN | The slack bot token | a valid token |
- |
Yes |
SLACK_APP_TOKEN | The slack app token | a valid token |
- |
Yes |
Note: When you run the install command (using docker or locally), a .env file will be created automatically based on env.template
Command | Docker | Locally | Description |
---|---|---|---|
install | make docker/install |
make local/install |
to install |
tests | make docker/tests |
make local/tests |
to run the tests with coverage |
lint | make docker/lint |
make local/lint |
to run static code analysis using ruff |
lint/fix | make docker/lint/fix |
make local/lint/fix |
to fix files using ruff |
run | make docker/run |
make local/run |
to run the project |
build image | make docker/image/build |
- | to build the docker image |
push image | make docker/image/push |
- | to push the docker image |
Helpful commands
Please, check all available commands in the Makefile for more information.
The Bot supports multiple languages using i18n pattern.
Locale file structure:
├─ src
│ ├─ locales
│ │ └─ en
│ │ └─ LC_MESSAGES
│ │ └─ base.po
│ │ └─ pt_BR
│ │ └─ LC_MESSAGES
│ │ └─ base.po
src/locales
with the new language;base.po
file inside this folder (you just can copy from another language);mo
files using the command make generate-mo-files
;This project uses a simple way to configure the log with logging.conf to show the logs on the container output console.
This project uses a simple way to manage the settings with settings.conf and ConfigParser using a config class.