Identifying and alerting on data loss using Cloudflare Workers
Aug 30, 2018Rita Kozlov

Summary
This post introduces the use of Cloudflare Workers to detect and prevent data loss by inspecting the content of HTTP responses for sensitive 'canary' data. It demonstrates how Workers can be configured to block responses containing leaked sensitive information, return a static 'Blocked' response, and trigger external alerts (e.g., PagerDuty) via `event.waitUntil()` to notify of potential data breaches. It also touches upon rate-limiting responses as a secondary measure.
More from the Website Security & Threat Management trail
- We tested our own WAF with frontier AI models. Here’s what we found
- When scanners miss the attack: how Cloudflare Client-Side Security protects storefronts
- Introducing automatic remediation policies with Cloudflare CASB
- Introducing context-aware vulnerability discovery and remediation with Cloudflare Managed Defense and OpenAI Daybreak Models
- Introducing Adaptive Intelligence: undermining the economics of every bot attack