Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Slack Engineering 8 min read How-to mediumAdept

Slack Audit Logs and Anomalies

Slack Enterprise Grid audit logs record platform actions and include anomaly events that flag unusual behaviour such as new user agents, excessive downloads, unexpected scraping, IP address changes and session fingerprint mismatches. Anomalies are best treated as investigation leads rather than incidents: tune them by allowlisting trusted CIDR ranges and ASNs, correlate them (a user_agent plus excessive_downloads plus session_fingerprint pattern suggests a stolen cookie being used to scrape), and aggregate per-user counts against historical norms. Ingesting the full audit log stream, not just anomalies, supplies context such as which files were downloaded. A walkthrough of a departing employee scraping data shows the dashboard investigation flow and session termination, and recommends allowlisting expected user agents rather than blocklisting bad ones.

Related posts

  • Scaling ClickStack alerting with built-in anomaly detection

    ClickHouse mediumAdept

    Managed ClickStack adds z-score anomaly detection to query-builder charts, computing the expected value from a 7-bucket one-minute moving average and the standard deviation over a longer baseline (two hours by default). A minimum 5% relative change keeps stable metrics with near-zero variance from firing, and a 30-second delay prevents batched collector sends from looking like drops. Alert evaluation was scaled to tens of thousands of alerts by loading configs only for due alerts, running lookups concurrently, batching result writes, moving webhook delivery to a background queue, and hash-sharding alerts across workers with backfill for missed windows. The current detector misses gradual drift and seasonality, so static thresholds remain recommended for persistent limits.

  • Proactive Measures Against Password Breaches and Cookie Hijacking

    Slack Engineering easyNovice

    Slack automatically invalidates user credentials that show up in threat intelligence feeds from breaches, dark web forums, botnets and infostealer malware. Leaked passwords are matched against Slack's salted-hash store by salting and hashing each candidate in parallel batches on a job queue. On a match the password is reset and blocked from reuse, and the candidate data is then discarded. Hijacked session cookies are also invalidated, but timed to fall outside the user's local weekday working hours so no one is logged out mid-conversation, with email notification and Enterprise audit log events. This builds on Slack's regex-based scanning, in place since 2016, that revokes tokens and webhooks leaked in public code.

  • How we're using Sourcegraph and a Slack bot to detect vulnerabilities and react quickly

    Sourcegraph mediumAdept

    Sourcegraph built a Slack bot that polls the GitHub Advisory Database every 15 minutes, triages advisories with CVSS, Hacker News buzz and a high-reach package list plus supply-chain keywords, and on a single 🚀 reaction generates detection queries, a blog scaffold, social drafts and an auto-edited Deep Search demo video. The design avoids an orchestrator. It uses JSON incident descriptors and one-shot Node scripts, auto-commits inert manifests to a private indexed demo repo through a narrowly scoped PAT, and parks borderline advisories for 12 hours to prevent alert fatigue. An ffmpeg scene-detection, burst-clustering and anchor-filtering pipeline cut a 210-second capture to 19 seconds of content. Putting a 'DO NOT INSTALL' note in the manifest made Deep Search discard the match as synthetic, so the disclosure was moved to the repo README.

  • Lessons on UX, security, and scale when building an enterprise-grade Slack agent

    Sourcegraph mediumAdept

    Sourcegraph's Deep Search Slack agent fits into enterprise workflows through staged status messages (emoji acknowledgement, escalation links for long searches), TL;DR answers with threaded follow-ups, and rich link unfurling via Slack's link_shared events, SHA256-based entity IDs, chat.unfurl work objects and flexpane details. On the enterprise side it supports Enterprise Grid's one-app-to-many-workspaces model, auto-links Slack users to Sourcegraph accounts by verified email so permissions match code access, and validates setup by forcing a fresh Slack event-URL ping with a random retry parameter. Abuse is controlled with simple Redis fixed-window counters per user and team that fail open if Redis is down.

  • Catching Compromised Cookies

    Slack Engineering mediumAdept

    Slack detects stolen session cookies by spotting session forking: a last-access timestamp is stored in both the cookie and the database, and a mismatch on a later request means more than one copy of the cookie is in use. Early false positives from clients that never received refreshed cookies were cut by matching IP addresses and by a two-phase, idempotent "session candidate" cookie that is promoted only after the client proves it stored the new value. In-flight request races are handled by ignoring timestamps right after an update. Database reads are skipped while a cookie is freshly issued. High-risk detections, scored using device and network signals, go to the audit log for customers' SIEMs.

The quest for software engineering knowledge.

Look:
Layout: