Slack Bot
Scan URLs in your workspace channels as they're posted.
How it works
The agent joins your channels and flags phishing URLs the moment they're shared. It follows the same engine as the other bots — malicious (≥ 70), suspicious (40–69), or safe — with optional warnings for suspicious links.
Slack has two deployment paths — a hosted "Add to Slack" OAuth flow that any workspace can install, or a pre-authorized Socket Mode app. The agent flags malicious URLs but cannot delete other members' messages.
Install (Add to Slack)
This is the multi-tenant path. One Socket Mode process serves every workspace; each workspace's bot token is stored encrypted at rest (Fernet) in the tenant store.
- Create the app from the manifest: in api.slack.com/apps → Create New App → From an app manifest, and paste
deploy/slack-manifest.yaml. - Set the OAuth redirect URL in OAuth & Permissions to match
SLACK_REDIRECT_URI. - Create an app-level token (
xapp-,connections:write) under Basic Information → App-Level Tokens. - Point your "Add to Slack" button at
https://your-host.example.com/slack/install. After a workspace installs, the agent joins its public channels and DMs the installer a welcome.
Configuration
Fill in only the platforms you're deploying. Generate PHISHINGBOT_FERNET_KEY with:
Commands
| Command | Description |
|---|---|
| /scan <url> | Manually scan a URL |
| /phisherman status | Agent status + API-key health |
| /phisherman settings | Show current behavior |
| /phisherman settings <key> on|off | Change behavior (admins) |
| /phisherman mute | unmute | Pause/resume this channel |
| /phisherman key <ph_...> | Set a per-team API key (admins) |
| /phisherman help | Show help |
Settings
| Setting | Default | Meaning |
|---|---|---|
| delete_malicious_messages | off | Delete confirmed malicious messages |
| warn_on_suspicious | on | Post a warning for suspicious URLs |
| post_all_results | off | Also report safe URLs |
| alert_on_error | on | Post a notice when scanning fails (e.g. bad key) |
Running the agent
Two processes share the tenant store: slack-agent (Socket Mode worker) and server (FastAPI serving the OAuth endpoints).
Or as containers:
Verify
In an authorized channel, run /phisherman status, then /scan https://example.com.
Troubleshooting
| Symptom | Fix |
|---|---|
| Slack not responding | Confirm Socket Mode is on and SLACK_APP_TOKEN is set |
| Workspace doesn't appear | Check data/store.db for a tenant (the app wasn't installed) |
| Tokens stored in plaintext | Set PHISHINGBOT_FERNET_KEY in production |