Slack¶
Slack is a messaging platform for teams; audit logs need the Enterprise plan (an Enterprise organization, formerly Enterprise Grid).
- What DRACO uses: Enterprise organization audit logs and users; channels to post to.
- What for: Detections, UEBA and hunts on workspace events, the ID directory and its users, messages from workflows, posture alerts posted to channels, and deactivating or signing out users from incidents and workflows.
Add it in Connectors > Add connector: pick Slack, then choose what DRACO collects and what it may change. Add more later with Add a part on its connector page. See Connectors for how connectors, sign-in and tags work.
Parts¶
| Part | What DRACO uses | Access | Permissions |
|---|---|---|---|
| Logs | Slack audit logs | read | A user token (xoxp-) of an app installed on the Enterprise organization (not a workspace) by its Owner, with the user scope auditlogs:read; token rotation left off. |
| Directory | Slack audit logs | read | The user token scopes users:read and users:read.email on the same app (the Owner reinstalls it on the organization). |
| Notifications | Post message (Slack) | write | A Slack app bot token (xoxb-) with chat:write (chat:write.public to post without joining); channels:history / groups:history lets a repeat find the message already posted |
| Response | Deactivate user (Slack), Sign out user (Slack) | write | Deactivate user (Slack): a user token (xoxp-) of an admin app installed by an Owner (on Enterprise: by the Org Owner, on the organization), user token scope admin (SCIM API; Business+ or Enterprise plan) Sign out user (Slack): the same admin app, user token scope admin.users:write (users:read.email to find users by email; Enterprise plan only) |
Requirements¶
- The Enterprise plan: an Enterprise organization (formerly Enterprise Grid), for the audit logs and the users. Posting messages works on any plan.
- For the responders: Deactivate user uses Slack's SCIM API, on the Business+ or Enterprise plan; Sign out user needs the Enterprise plan.
- The Owner of the Enterprise organization, to install the app on the organization.
Logs¶
The Slack audit logs data source (slack_audit_logs) reads the Slack Audit Logs API of your Enterprise organization: sign-ins, user and role changes, sessions, apps and their scopes, channels and Slack Connect, files, exports, and workspace or org settings.
Enterprise plan only
Slack offers the Audit Logs API only on the Enterprise plan (formerly Enterprise Grid). On Free, Pro and Business+ plans Slack answers feature_not_enabled and the source cannot be created (the wizard's test fails with that message).
Client setup (Owner of the organization)¶
- Create a Slack app at api.slack.com/apps > Create New App > From scratch. Name it (for example
DRACO audit logs) and pick any workspace of the organization as its development workspace. - Add the scope: OAuth & Permissions > User Token Scopes > Add an OAuth Scope >
auditlogs:read. - Leave token rotation off (OAuth & Permissions > Advanced token security via token rotation). Once on, Slack cannot turn it off and the token expires every 12 hours: if it is on, create a new app.
- Install the app on the organization, not on a workspace, as its Owner. Slack documents two ways: opt the app in to being organization-ready and install it to the organization (Slack may ask for one bot scope first), or Manage Distribution > Activate Public Distribution, open the Sharable URL and pick the organization in the dropdown of the install screen. Installing on a single workspace gives a token that the Audit Logs API refuses (
not_allowed_token_type). - Copy the User OAuth Token (it starts with
xoxp-) from Install App (or OAuth & Permissions).
The token can read the audit log of the whole organization and nothing else.
Add the source in DRACO¶
- Connectors > Add connector, pick Slack and tick Logs under Collectors (or Add a part on the Slack connector you already have).
- Settings: the poll interval (5 minutes by default). Optional: how far the first run looks back (24 hours), the re-read window for late entries (30 minutes) and the pages per run (10 pages of 1,000 entries).
- Credential: a Token credential (vendor
slack) with thexoxp-token. You can create it in the wizard. Bot tokens (xoxb-) are refused before any call. - Test connection: DRACO reads the latest entries and shows them parsed. The source is created only after a passing test; Slack's error codes become messages that name the fix (see Troubleshooting).
What DRACO collects¶
One event per audit log entry:
| Event field | From the entry |
|---|---|
| time | date_create |
action |
Slack's action, for example user_login, role_change_to_admin, app_installed, file_public_link_created, pref.two_factor_auth_changed |
actor_user |
actor.user.email (else the user name or id, or the app or workflow) |
src_ip, user_agent |
context.ip_address, context.ua |
host |
the workspace or org domain (context.location.domain) |
cloud_account |
the workspace or enterprise id (context.location.id) |
resource_uid |
the entity's email, name or id (the user, app, channel, file or workspace) |
| status | failure for user_login_failed, success otherwise |
| class | Authentication for sign-ins, Account Change for roles, users and sessions, File Activity for files, API Activity for the rest |
message |
who did what to which entity, where and from where: [email protected]: user_login on user [email protected] in enterprise birdland from 203.0.113.40: succeeded |
| fields | the whole entry: actor, entity, context, details (previous and new values, scopes...) and id |
Search examples:
source_type=slack_audit_logs action=user_login_failed | stats count by actor_user, src_ip
source_type=slack_audit_logs action IN (app_installed, app_scopes_expanded) | table ts, actor_user, entity.app.name, entity.app.scopes
source_type=slack_audit_logs action=pref.* | table ts, actor_user, action, details
IDs resolved (Readable IDs): user ID → e-mail (or name); app, file, channel and workflow IDs → name; workspace (team) and enterprise IDs → name.
Latency¶
Slack does not publish a delivery time for audit entries; they usually appear within minutes. DRACO re-reads the last 30 minutes on every poll and skips the entries it already stored (by entry id), so late entries are not lost and nothing is stored twice. The API returns the newest entries first: when a run reaches its page limit, Slack's cursor and the time window are kept and the next run finishes the same window.
Slack rate-limits the Audit Logs API (Tier 3, about 50 requests a minute). A 429 is retried after the Retry-After delay Slack sends; if Slack keeps refusing, the run stops and the next one continues from the same point.
Built-in rules¶
The draco-saas pack has these rules for this source (Detections > Built-in). The ones marked recommended are on by default.
| Rule | Severity | Fires on |
|---|---|---|
| Workspace or org admin or owner added (recommended) | high | role_change_to_admin, role_change_to_owner, ownership transfers |
| SSO or two-factor settings changed (recommended) | high | pref.* settings about SSO, SAML or two-factor authentication |
| Data export started or enabled (recommended) | high | manual, scheduled and channel exports started; corporate exports enabled or approved |
| App installed or expanded with broad scopes (recommended) | medium | app_installed, app_scopes_expanded, app_approved... with admin*, *:history, files:read or client scopes |
| Public channel shared with an external organization | medium | Slack Connect invitations of a public channel sent, accepted or approved |
| Public link to a file created | medium | file_public_link_created |
| User sessions reset | low | user_session_reset_by_admin, user_session_invalidated |
Each rule has What to do guidance (triage, likely false positives, containment).
Directory¶
Pulls the vendor's directory into the ID directory (readable names for alerts, incidents and investigations) and the assets: the users of every workspace of the organization (admin and owner, two-factor, deactivated, bots). It signs in with the sign-in of the logs part, so turn logs on first, then turn on Directory on the connection (or tick Pull the directory in the log source's settings) and run Test: the Directory row reads one page of each part and names a missing permission.
Permissions (read): add the User Token Scopes users:read and users:read.email to the app of the audit logs; the Owner reinstalls it on the organization and you store the new user token in the log source's credential.
DRACO reads the directory every hour (only what changed, where the vendor's API allows it) and in full once a day. Names and asset facts the vendor no longer lists are removed after the ID retention period. When the pull fails three times in a row, the connection shows the error and a connector health problem is opened.
Notifications¶
Posts messages to Slack channels from workflows, and the findings of posture alert rules.
Setup: Messages, tickets and clusters.
Findings to Slack¶
A notification rule with a finding trigger (After scan, Daily or both, under Connectors > Notifications) can post to Slack besides its e-mail recipients:
- Add the bot above: tick Notifications under Responders on the Slack connector and set its channel. That Post message responder is the channel.
- In the notification rule pick it under Destination channels. Each Post message responder is one channel; add one per channel.
- When the rule fires, DRACO posts one message per run: the number of failing findings by severity, then the top findings, each with its severity, check, resource, account (provider and account id) and an Open link to it on the Findings page, and a link to all failing findings.
The message is an execution of the Post message responder, recorded like its other executions. If Slack refuses it (the bot is not in the channel, the token was revoked), the rule's history shows the error and the e-mail recipients still get it.
Response¶
Deactivate a user or sign them out of Slack from an incident, an investigation or a workflow. The target is a Slack user id (U0123ABCD or W0123ABCD) or the user's email; an email target is checked against the allowlist like every other target.
| Action | What it does | Undo | Plan |
|---|---|---|---|
| Deactivate user | deactivates the account through Slack's SCIM API: the user is signed out everywhere and cannot sign in | reactivates the account | Business+ or Enterprise |
| Sign out user | ends every web, desktop and mobile session (admin.users.session.reset) |
not reversible: the user signs in again | Enterprise |
Client setup (Owner)¶
- Sign in to Slack as an Owner (on Enterprise: the Org Owner), open api.slack.com/apps and click Create New App > From scratch. Name it
DRACO response. Keep it separate from the audit app and the posting bot. - OAuth & Permissions > User Token Scopes: add
adminfor Deactivate user, andadmin.users:writeandusers:read.emailfor Sign out user. - Leave token rotation off.
- Install the app: on Enterprise, opt it in to being organization-ready and install it to the organization; on Business+, Install to Workspace. Click Allow.
- Copy the User OAuth Token (
xoxp-). It acts as the Owner who installed it: keep that account an Owner or Admin.
| Type | Item | Access | Why |
|---|---|---|---|
| User Token Scope | admin |
write | Deactivate user and its Undo (SCIM API) |
| User Token Scope | admin.users:write |
write | Sign out user |
| User Token Scope | users:read.email |
read | Sign out user finds the user by email |
An Admin's token cannot change Owners, and nobody can deactivate or sign out the Primary Owner.
Add it in DRACO¶
- Connectors > Add connector, pick Slack and tick Response under Responders (or Add a part on the Slack connector you already have).
- Write access: a Token credential (vendor
slack) with thexoxp-token. - Test: DRACO reads the token's scopes and, for Deactivate user, one page of users. Nothing is changed; a missing scope is named.
Troubleshooting¶
| The test or a run says | Fix |
|---|---|
| feature_not_enabled | The organization is not on the Enterprise plan: the Audit Logs API is not available. |
| missing_scope | Add auditlogs:read under User Token Scopes (not bot scopes), reinstall the app on the organization and store the new token. |
| not_allowed_token_type | Use the user token (xoxp-) of an app installed on the organization; bot tokens and workspace installs are refused. |
| team_not_authorized / user_is_restricted | The Owner of the Enterprise organization must install the app at the organization level. |
| token_expired, or an xoxe- token | Token rotation is on for the app and Slack cannot turn it off: create a new app without token rotation and store its User OAuth Token. |
| invalid_auth / invalid_authentication / token_revoked | The token is wrong or revoked, or the app was not installed by the Owner of the organization: reinstall and store the new token. |
| rate limit reached | Slack throttled the API; DRACO retried, and the next run continues from the same point. |
| Deactivate user: refused the SCIM call (HTTP 403) | Add the user token scope admin, install the app as an Owner (Enterprise: on the organization) and check the plan is Business+ or Enterprise. An Admin's token cannot change an Owner. |
| Sign out user: needs the Slack Enterprise plan | admin.users.session.reset exists on the Enterprise plan only. |
| Destination channels: no channels available | Add a Post message responder to the Slack connector, then open the alert rule again. |