Skip to main content

detections

Creates, updates, deletes, gets or lists a detections resource.

Overview

Namedetections
TypeResource
Idcloudflare.leaked_credential_checks.detections

Fields

The following fields are returned by SELECT queries:

Get Leaked Credential Checks custom detection response.

NameDatatypeDescription
idstringDefines the unique ID for this custom detection. (example: 18a14bafaa8eb1df04ce683ec18c765e)
passwordstringDefines ehe ruleset expression to use in matching the password in a request. (example: lookup_json_string(http.request.body.raw, "secret"))
usernamestringDefines the ruleset expression to use in matching the username in a request. (example: lookup_json_string(http.request.body.raw, "user"))

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectzone_id, detection_idGet user-defined detection pattern for Leaked Credential Checks.
listselectzone_idList user-defined detection patterns for Leaked Credential Checks.
createinsertzone_idCreate user-defined detection pattern for Leaked Credential Checks.
updatereplacezone_id, detection_idUpdate user-defined detection pattern for Leaked Credential Checks.
deletedeletezone_id, detection_idRemove user-defined detection pattern for Leaked Credential Checks.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
detection_idstring
zone_idstringThe Cloudflare zone ID.

SELECT examples

Get user-defined detection pattern for Leaked Credential Checks.

SELECT
id,
password,
username
FROM cloudflare.leaked_credential_checks.detections
WHERE zone_id = '{{ zone_id }}' -- required
AND detection_id = '{{ detection_id }}' -- required
;

INSERT examples

Create user-defined detection pattern for Leaked Credential Checks.

INSERT INTO cloudflare.leaked_credential_checks.detections (
password,
username,
zone_id
)
SELECT
'{{ password }}',
'{{ username }}',
'{{ zone_id }}'
RETURNING
errors,
messages,
result,
success
;

REPLACE examples

Update user-defined detection pattern for Leaked Credential Checks.

REPLACE cloudflare.leaked_credential_checks.detections
SET
password = '{{ password }}',
username = '{{ username }}'
WHERE
zone_id = '{{ zone_id }}' --required
AND detection_id = '{{ detection_id }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Remove user-defined detection pattern for Leaked Credential Checks.

DELETE FROM cloudflare.leaked_credential_checks.detections
WHERE zone_id = '{{ zone_id }}' --required
AND detection_id = '{{ detection_id }}' --required
;