Skip to main content
The Leaked Credential Checks API helps protect your applications by detecting when users attempt to log in with credentials that have been exposed in data breaches. This service checks login attempts against a database of known leaked credentials.

Initialize the Leaked Credential Checks resource

Configuration

Enable Leaked Credential Checks

Enable or disable Leaked Credential Checks for a zone.
string
required
Zone identifier
boolean
Enable or disable Leaked Credential Checks

Get configuration status

Retrieve the current status of Leaked Credential Checks.

Detections

Manage custom detection patterns for identifying username and password fields in login requests.

Create detection

Create a user-defined detection pattern.
string
required
Zone identifier
string
Ruleset expression to match the username in a request. For example:
  • http.request.body.form["email"]
  • http.request.body.json["user"]
  • http.request.headers["x-username"][0]
string
Ruleset expression to match the password in a request. For example:
  • http.request.body.form["password"]
  • http.request.body.json["pass"]
  • http.request.body.form["user_password"]

Update detection

Update an existing detection pattern.

List detections

List all user-defined detection patterns.

Get detection

Retrieve a specific detection pattern.

Delete detection

Remove a user-defined detection pattern.

Use cases

Protect login forms

Set up detection for a standard HTML form login.

Protect JSON API logins

Set up detection for a JSON-based authentication API.

Multiple login endpoints

Create multiple detection patterns for different login endpoints.

Audit existing detections

Review all configured detection patterns.

Response types

LeakedCredentialCheckCreateResponse

Configuration status for Leaked Credential Checks.
boolean
Whether Leaked Credential Checks are enabled

LeakedCredentialCheckGetResponse

Current status of Leaked Credential Checks.
boolean
Whether Leaked Credential Checks are enabled

DetectionCreateResponse

User-defined detection pattern.
string
Unique ID for this custom detection
string
Ruleset expression to match the username in a request
string
Ruleset expression to match the password in a request

DetectionListResponse

List item for a detection pattern.
string
Unique ID for this custom detection
string
Ruleset expression to match the username
string
Ruleset expression to match the password
string
When the detection was created
string
When the detection was last updated

Best practices

Test your expressions: Before deploying to production, test your username and password expressions to ensure they correctly identify the credential fields in your login requests.
Multiple endpoints: If your application has multiple login endpoints with different field names, create separate detection patterns for each.
Monitor alerts: Set up monitoring for leaked credential alerts to quickly identify and respond to potential account compromises.
Leaked Credential Checks can only detect credentials that match known data breaches. It should be used as part of a comprehensive security strategy that includes strong password policies, multi-factor authentication, and account monitoring.

Expression examples

Common expression patterns for different login implementations:

HTML form POST

JSON API

Headers