Data leak protection
Data leak protection of one site: checks pages, JSON and text returned by the origin for phone numbers, ID card numbers, bank card numbers, keys and error messages, and masks, blocks or replaces them with an error page; part of WAF Enhanced.
site-leak-guardsProtectionAuthentication: User (some parameters admin only)3 endpointsGet site data leak protection settings
GET
/api/v2/site-leak-guards/{site_id}Authentication: User (some parameters admin only)
Set site data leak protection
PUT
/api/v2/site-leak-guards/{site_id}Authentication: User (some parameters admin only)
Request body application/json
| Field | Type | Required | Description |
|---|---|---|---|
| custom | SiteLeakGuardCustom[] | — | Custom regular expressions, at most 16. |
| detect | SiteLeakGuardDetect | — | Action per built-in pattern; omit a pattern to not check it. |
| enabled | boolean | Required | Whether enabled. |
| exclude | string[] | — | Path prefixes that are not checked, at most 32. |
| expected_updated_at | string | — | Optimistic lock - the updated_at as the caller read it (when null, i.e. never set, use 1970-01-01T00:00:00Z). If it differs from the stored one, 409 stale_version is returned and nothing is saved; omit to skip the check. |
| observe_days | integer | — | Days observed after turning on. |
Restore site data leak protection to the scheme
DELETE
/api/v2/site-leak-guards/{site_id}Authentication: User (some parameters admin only)
Data leak protection object
| Field | Type | Required | Description |
|---|---|---|---|
| custom | SiteLeakGuardCustom[] | — | Custom regular expressions, at most 16. |
| detect | SiteLeakGuardDetect | — | Action per built-in pattern; omit a pattern to not check it. |
| enabled | boolean | — | Whether enabled. |
| exclude | string[] | — | Path prefixes that are not checked, at most 32. |
| expected_updated_at | string | — | Optimistic lock - the updated_at as the caller read it (when null, i.e. never set, use 1970-01-01T00:00:00Z). If it differs from the stored one, 409 stale_version is returned and nothing is saved; omit to skip the check. |
| gate | string | — | WAF Enhanced status of the site's tenant: full = editable; readonly = expired but within the read-only buffer (License.readonly_days, 7 days by default), still in effect but read-only; basic = not subscribed or past the buffer, nothing checked and settings kept. |
| gate_expired_at | string | — | Administrator responses with gate_reason=expired only - when the platform WAF Enhanced license expired; not present in tenant responses. |
| gate_owner | WafGateOwner | — | The owner of the site, in administrator responses only; tenant responses carry no one else's information. |
| gate_packages | string[] | — | Administrator responses only - names of the owner's unexpired packages (at most 20); not present in tenant responses. |
| gate_reason | WafGateReason | — | Why WAF Enhanced (waf_enhanced) is not in effect; absent when gate is full or readonly. package = the platform is licensed but the owner has no unexpired package that includes WAF Enhanced; license = the platform has not enabled it (never licensed, revoked by the provider, or the license was disabled); expired = the platform license has expired and its read-only buffer period (License.readonly_days, default 7 days) has passed, so it fell back to basic. |
| observe_days | integer | — | Days observed after turning on. |
| observe_until | string | — | End of the observation period; null = not observing (never on, or 0 days chosen). |
| site_id | integer | — | Site ID |
| source | ProtectSiteSource | — | Where the site's setting comes from: scheme = follows the scheme (changes when the scheme is saved); custom = set for this site alone (including turned off and rows migrated from before). |
| updated_at | string | — | Version (null if never set); use expected_updated_at on update. |