Cloudflare.Dlp reference
Source:
src/Cloudflare/Dlp/Entry.ts
A Cloudflare Zero Trust DLP custom entry — a standalone regular-
expression detection that can be attached to a custom DLP profile.
Use it when entries are managed independently of the
Profile that groups them.
Requires the Cloudflare DLP entitlement (a paid Zero Trust add-on);
accounts without it receive the typed Forbidden error on all writes.
Entry: Creating a DLP entry
Section titled “Entry: Creating a DLP entry”Attach a regex entry to a profile
const entry = yield* Cloudflare.Dlp.Entry("EmployeeId", { pattern: { regex: "EMP-[0-9]{6}" }, profileId: profile.profileId,});Luhn-validated card entry
const card = yield* Cloudflare.Dlp.Entry("CardNumber", { pattern: { regex: "[0-9]{13,16}", validation: "luhn" }, profileId: profile.profileId,});Profile
Section titled “Profile”Source:
src/Cloudflare/Dlp/Profile.ts
A Cloudflare Zero Trust DLP custom profile — a named collection of detection entries (regular expressions) that Gateway HTTP policies and CASB integrations reference to detect sensitive data in transit.
Requires the Cloudflare DLP entitlement (a paid Zero Trust add-on);
accounts without it receive the typed Forbidden error on all writes.
Profile: Creating a DLP profile
Section titled “Profile: Creating a DLP profile”Profile with a custom regex entry
const profile = yield* Cloudflare.Dlp.Profile("EmployeeIds", { description: "Detects internal employee identifiers", allowedMatchCount: 0, entries: [ { name: "employee-id", enabled: true, pattern: { regex: "EMP-[0-9]{6}" }, }, ],});Credit-card-like entry with Luhn validation
const cards = yield* Cloudflare.Dlp.Profile("Cards", { entries: [ { name: "card-number", enabled: true, pattern: { regex: "[0-9]{13,16}", validation: "luhn" }, }, ],});