Skip to content
AnswerWell geo Documentation

Research · 8 min read · Answerwell

Data Loss Prevention Profiles, Detection Entries, and Gateway Policy

How Zero Trust DLP profiles, detection entries, data classes, and Gateway HTTP policies detect and control sensitive data in transit and at rest.

This page summarizes Cloudflare Zero Trust Data Loss Prevention (DLP) documentation: how profiles define what to detect, how detection entries and Data Classification supply reusable logic, and how Gateway HTTP policies enforce allow, block, or log actions on traffic that carries sensitive data.

Cloudflare Data Loss Prevention (DLP) allows you to scan your web traffic and SaaS applications for the presence of sensitive data such as social security numbers, financial information, secret keys, and source code.

— Cloudflare, Data loss prevention

DLP scans HTTP bodies (not headers) when traffic flows through Cloudflare Gateway with TLS decryption, complements CASB for data at rest, and can integrate with outbound Email Security DLP for Microsoft 365. Cloudflare does not write scanned content to disk; content is encrypted and held in memory only unless you configure payload logging or Logpush.

DLP profiles: what sensitive data a policy can match

Section titled “DLP profiles: what sensitive data a policy can match”

A DLP profile defines what Cloudflare detects. It combines detection entries, optional data classes and labels from Data Classification, and profile settings such as confidence thresholds.

In order to use Data Loss Prevention (DLP) tools within Cloudflare Zero Trust, you first need to define your DLP profiles. DLP profiles are complex objects with dictionaries, pre-built detections, and custom logic that you can reference as selectors within your Gateway policies.

— Cloudflare, Build Data Loss Prevention (DLP) policies

Cloudflare offers three profile types:

Profile type When to use it Source
Predefined profiles Common patterns (PII, financial data, credentials, source code, health data) Cloudflare-managed entries you enable per profile
Custom profiles Organization-specific regex, datasets, documents, or combined logic Detection entries you create or reuse
Integration profiles Microsoft Purview/MIP labels already in use CASB pull; entries are read-only in Cloudflare

Most predefined and custom profiles match when any enabled detection entry matches. The Personally Identifiable Information (PII) Record profile is an exception: it matches only when at least three unique detection entries appear in close proximity, which reduces false positives from isolated values.

Detection entries: patterns, datasets, and documents

Section titled “Detection entries: patterns, datasets, and documents”

Detection entries are reusable logic you manage under Zero Trust → Data loss prevention → Detection entries, then attach to one or more profiles or data classes.

Detection entries are the reusable detection logic that Cloudflare DLP uses to identify sensitive content in your web traffic and SaaS applications. You can create and manage detection entries independently of DLP profiles, then add the same entry to one or more custom profiles.

— Cloudflare, Detection entries

Entry types include pattern (regex) entries, predefined detection entries, Exact Data Match (EDM) and Custom Wordlist (CWL) datasets, document fingerprints, and AI prompt topics.

Custom regex uses Rust syntax, not JavaScript or PCRE. Validate with Rustexp. Patterns are limited to 1024 bytes; unbounded + and * quantifiers are not supported—use bounded ranges such as a{1,1024}.

For inline HTTP scanning, DLP inspects POST request bodies and only the first 1,024 bytes of the body (Detect MCP traffic in Gateway logs). Design policies knowing large uploads may not expose the full payload to DLP.

Aspect Exact Data Match (EDM) Custom Wordlist (CWL)
Storage / comparison Hashed; compared to hashed traffic Plaintext in DLP
Payload logs Matches redacted Matches may appear in logs
Typical use PII (names, cards, account numbers) SKUs, internal codes, project names
Case sensitivity N/A (hashed) Optional Enforce case sensitivity (changelog)

Account limits cap custom entries (25), EDM cells per spreadsheet (100,000), CWL keywords (200 per spreadsheet, 1,000 per account), and 1,000,000 dataset cells per account.

EDM files should use .csv or .txt with LF newlines; each row needs at least six characters. For highly sensitive column data, prefer EDM; for keyword lists, CWL—with column headers removed from CWL files to avoid false positives.

Document-based entries accept .docx and .txt up to 10 MB, build an encrypted fingerprint, and match by configurable similarity (0–100%) in Gateway or CASB scans.

Custom pattern entries can call a Cloudflare Worker (DlpValidationEntrypoint.validate) to adjust confidence (-1 to 1) or return veto to reject a match.

Data Classification: labels and reusable data classes

Section titled “Data Classification: labels and reusable data classes”

Data Classification adds labels (sensitivity schemas/levels, data tag groups/tags) and data classes that combine detection entries with logical AND / OR, optionally referencing other data classes (recursive self-reference is blocked).

Data classes are reusable classification rules built from detection entries, other data classes, sensitivity levels, and data tags.

— Cloudflare, Build a data class

Use classification when you need consistent severity labels across many profiles; use detection entries alone when you only need a single pattern enforced immediately (when to use each). Configure labels and templates from the dashboard or Cloudflare-managed templates.

Gateway DLP policies: block, log, or scope by destination

Section titled “Gateway DLP policies: block, log, or scope by destination”

After a profile exists, reference it in an HTTP policy with the DLP Profile selector, for example any(dlp.profiles[*] in {<UUID>}).

Scan HTTP traffic recommends starting with a predefined profile, then combining DLP with destination, method, application, or identity selectors so enforcement targets high-risk paths rather than all traffic.

The best way to start applying data loss prevention to your traffic, minimize the chance of false positives, and collect actionable data is to start with the known knowns in your sensitive data policies. Rather than building policies to detect sensitive data like SSNs or financial information across all of your traffic, you should start by building policies that target both sensitive data types and destinations that are known data sources or points of high risk.

— Cloudflare, Build Data Loss Prevention (DLP) policies

Example API shape for blocking when any of two profiles match (same learning path):

curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rules" \
--request POST \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"action": "block",
"enabled": true,
"filters": ["http"],
"traffic": "any(dlp.profiles[*] in <CREDENTIALS_DLP_PROFILE_UUID>) or any(dlp.profiles[*] in <AWS_DLP_PROFILE_UUID>)"
}'

Source code, OCR, and account-level DLP settings

Section titled “Source code, OCR, and account-level DLP settings”

The Source Code predefined profile uses NLP for languages such as Python, Java, Go, and Rust. Source code detection improvements focus on whole file uploads/downloads (minimum 500 characters); snippets in chat or .docx are not treated as standalone source files.

Account-level DLP settings (under DLP settings) centralize OCR (.jpg/.jpeg/.png, 4 KB–1 MB), AI context analysis (Gateway HTTP/HTTPS only), and payload log masking. Settings use OR logic with legacy profile-level toggles during migration; profile-level advanced settings are being deprecated.

Payload log masking options (changelog):

  • Full Mask (default): mask while preserving length/format
  • Partial Mask: reveal 25% of the match
  • Clear Text: store full match for investigation (applied at detection time, before encryption)

Profile confidence thresholds (Low / Medium / High) further tune how many proximity keywords a match needs before the profile triggers.

Passive Detection and Test scan before production

Section titled “Passive Detection and Test scan before production”

Passive Detection samples Gateway HTTP request/response bodies without requiring a DLP enforcement policy, so you can see which detection entries appear, where they go, and policy coverage gaps. Prerequisites include HTTP filtering, TLS decryption, and enabling entries in at least one profile. Results are sampled—not a guarantee that no sensitive data exists.

Test scan sends paste, file, or HAR input directly to the DLP scanner—no Gateway policy evaluation and no Gateway activity logs. Use it to validate profiles before block rules, or to separate profile misconfiguration from policy or decryption issues (example workflow). Configuration changes may take up to two minutes to appear in Test scan.

Section titled “Data at rest, analytics, and related products”

The same profiles apply to CASB DLP scans of SaaS storage (API-based; Gateway split-tunnel settings do not affect at-rest scans). Data security analytics in Zero Trust → Insights combines CASB findings with DLP policy activity over HTTP.

Do not confuse Zero Trust DLP with WAF Sensitive Data Detection (Enterprise response-body logging at the edge) or the separate Data Localization Suite—DLP is Gateway/CASB-centric Zero Trust inspection, not data residency controls.

  • Enabling a broad predefined profile (for example Credentials and Secrets) with Block on all traffic.
  • Expecting the PII Record profile to match a single email or card (proximity rule).
  • Using JavaScript-style regex instead of Rust, or patterns longer than 1024 bytes.
  • Assuming Test scan success means Gateway sees the same traffic (check TLS decryption, Do Not Inspect, and POST/body limits).
  • Turning on Partial Mask or Clear Text without understanding that all enabled detections in the payload window log at that level.
  • Uploading EDM with CRLF newlines or CWL files that still contain spreadsheet header rows.
  1. In the Cloudflare dashboard, open Zero Trust → Insights & Logs → Dashboards → Passive Detection, confirm sampled detections for entries enabled in your profiles, and review destinations before writing block rules.
  2. Run Test scan with representative text or files against the profiles you plan to enforce; download dlp-scan-results.json only if you can store it securely.
  3. Create or edit an HTTP policy with the DLP Profile selector, test via dlptest.com, then confirm matches under Zero Trust → Insights → Logs → HTTP request logs with DLP filters (data security analytics).
  4. Review Zero Trust → Data loss prevention → DLP settings for OCR, AI context analysis, and payload masking aligned to your incident-response needs (DLP settings).
  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about so it can be corrected or explained.