Cloudflare Exposed Credentials Check Managed Ruleset
The Cloudflare Exposed Credentials Check Managed Ruleset is a set of pre-configured rules for well-known CMS applications that perform a lookup against a public database of stolen credentials.
The managed ruleset includes rules for the following CMS applications:
- WordPress
- Joomla
- Drupal
- Ghost
- Plone
- Magento
Additionally, this managed ruleset also includes generic rules for other common patterns:
- Check forms submitted using a
POSTrequest containingusernameandpasswordarguments - Check credentials sent as JSON with
emailandpasswordkeys - Check credentials sent as JSON with
usernameandpasswordkeys
The default action for the rules in managed ruleset is Exposed-Credential-Check Header (named rewrite in the API and in Security Events).
The managed ruleset also contains a rule that blocks HTTP requests already containing the Exposed-Credential-Check HTTP header used by the Exposed-Credential-Check Header action. These requests could be used to trick the origin into believing that a request contained (or did not contain) exposed credentials.
For more information on exposed credential checks, refer to Check for exposed credentials.
You can configure the following settings of the Cloudflare Exposed Credentials Check Managed Ruleset in the dashboard:
- Set the action to perform. When you define an action for the ruleset, you override the default action defined for each rule. The available actions are: Managed Challenge, Block, JS Challenge, Log, and Interactive Challenge. To remove the action override, set the ruleset action to Default.
- Override the action performed by individual rules. The available actions are: Exposed-Credential-Check Header, Managed Challenge, Block, JS Challenge, Log, and Interactive Challenge. For more information, refer to Available actions.
- Disable specific rules.
- Customize the filter expression. With a custom expression, the Cloudflare Exposed Credentials Check Managed Ruleset applies only to a subset of the incoming requests.
- Configure payload logging.
For details on configuring a managed ruleset in the dashboard, refer to Configure a managed ruleset.
To enable the Cloudflare Exposed Credentials Check Managed Ruleset for a given zone via API, create a rule with execute action in the entry point ruleset for the http_request_firewall_managed phase.
This example deploys the Cloudflare Exposed Credentials Check Managed Ruleset to the http_request_firewall_managed phase of a given zone ($ZONE_ID) by creating a rule that executes the managed ruleset. The rules in the managed ruleset are executed for all incoming requests.
-
Invoke the Get a zone entry point ruleset operation to obtain the definition of the entry point ruleset for the
http_request_firewall_managedphase. You will need the zone ID for this task.
At least one of the following token permissions is required:Required API token permissions
Response Compression WriteResponse Compression ReadConfig Settings WriteConfig Settings ReadDynamic URL Redirects WriteDynamic URL Redirects ReadCache Settings WriteCache Settings ReadCustom Errors WriteCustom Errors ReadOrigin WriteOrigin ReadManaged headers WriteManaged headers ReadZone Transform Rules WriteZone Transform Rules ReadMass URL Redirects WriteMass URL Redirects ReadMagic Firewall WriteMagic Firewall ReadL4 DDoS Managed Ruleset WriteL4 DDoS Managed Ruleset ReadHTTP DDoS Managed Ruleset WriteHTTP DDoS Managed Ruleset ReadSanitize WriteSanitize ReadTransform Rules WriteTransform Rules ReadSelect Configuration WriteSelect Configuration ReadBot Management WriteBot Management ReadZone WAF WriteZone WAF ReadAccount WAF WriteAccount WAF ReadAccount Rulesets ReadAccount Rulesets WriteLogs WriteLogs ReadLogs WriteLogs Read
Get a zone entry point ruleset curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets/phases/http_request_firewall_managed/entrypoint" \--request GET \--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"{"result": {"description": "Zone-level phase entry point","id": "<ENTRY_POINT_RULESET_ID>","kind": "zone","last_updated": "2024-03-16T15:40:08.202335Z","name": "zone","phase": "http_request_firewall_managed","rules": [// ...],"source": "firewall_managed","version": "10"},"success": true,"errors": [],"messages": []} -
If the entry point ruleset already exists (that is, if you received a
200 OKstatus code and the ruleset definition), take note of the ruleset ID in the response. Then, invoke the Create a zone ruleset rule operation to add anexecuterule to the existing ruleset deploying the Cloudflare Exposed Credentials Check Managed Ruleset (with IDc2e184081120413c86c3ab7e14069605). By default, the rule will be added at the end of the list of rules already in the ruleset.
At least one of the following token permissions is required:Required API token permissions
Response Compression WriteConfig Settings WriteDynamic URL Redirects WriteCache Settings WriteCustom Errors WriteOrigin WriteManaged headers WriteZone Transform Rules WriteMass URL Redirects WriteMagic Firewall WriteL4 DDoS Managed Ruleset WriteHTTP DDoS Managed Ruleset WriteSanitize WriteTransform Rules WriteSelect Configuration WriteBot Management WriteZone WAF WriteAccount WAF WriteAccount Rulesets WriteLogs WriteLogs Write
Create a zone ruleset rule curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets/$ENTRY_POINT_RULESET_ID/rules" \--request POST \--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \--json '{"action": "execute","action_parameters": {"id": "c2e184081120413c86c3ab7e14069605"},"expression": "true","description": "Execute the Cloudflare Exposed Credentials Check Managed Ruleset"}'{"result": {"id": "<ENTRY_POINT_RULESET_ID>","name": "Zone-level phase entry point","description": "","kind": "zone","version": "11","rules": [// ... any existing rules{"id": "<RULE_ID>","version": "1","action": "execute","action_parameters": {"id": "c2e184081120413c86c3ab7e14069605","version": "latest"},"expression": "true","description": "Execute the Cloudflare Exposed Credentials Check Managed Ruleset","last_updated": "2024-03-18T18:08:14.003361Z","ref": "<RULE_REF>","enabled": true}],"last_updated": "2024-03-18T18:08:14.003361Z","phase": "http_request_firewall_managed"},"success": true,"errors": [],"messages": []} -
If the entry point ruleset does not exist (that is, if you received a
404 Not Foundstatus code in step 1), create it using the Create a zone ruleset operation. Include a single rule in therulesarray that executes the Cloudflare Exposed Credentials Check Managed Ruleset (with IDc2e184081120413c86c3ab7e14069605) for all incoming requests in the zone.
At least one of the following token permissions is required:Required API token permissions
Response Compression WriteConfig Settings WriteDynamic URL Redirects WriteCache Settings WriteCustom Errors WriteOrigin WriteManaged headers WriteZone Transform Rules WriteMass URL Redirects WriteMagic Firewall WriteL4 DDoS Managed Ruleset WriteHTTP DDoS Managed Ruleset WriteSanitize WriteTransform Rules WriteSelect Configuration WriteBot Management WriteZone WAF WriteAccount WAF WriteAccount Rulesets WriteLogs WriteLogs Write
Create a zone ruleset curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets" \--request POST \--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \--json '{"name": "My ruleset","description": "Entry point ruleset for WAF managed rulesets","kind": "zone","phase": "http_request_firewall_managed","rules": [{"action": "execute","action_parameters": {"id": "c2e184081120413c86c3ab7e14069605"},"expression": "true","description": "Execute the Cloudflare Exposed Credentials Check Managed Ruleset"}]}'
To configure the Exposed Credentials Check Managed Ruleset via API, create overrides using the Rulesets API. You can perform the following configurations:
- Specify the action to perform for all the rules in the ruleset by creating a ruleset override.
Disable or customize the action of individual rules by creating rule overrides.
For examples of creating overrides using the API, refer to Override a managed ruleset.
For more information on working with managed rulesets via API, refer to Work with managed rulesets in the Ruleset Engine documentation.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark