eCDN WAFv2
The Web Application Firewall (WAF) is an important component in mitigating bad actors and protecting your storefront. For details, see eCDN Web Application Firewall.
With WAFv2, override specific managed rules and customize each ruleset to meet your specific traffic needs. WAFv2 rulesets are specifically designed to protect against threats such as zero-day vulnerabilities, top-10 attack techniques, and extraction of sensitive data, and are regularly updated as new vulnerabilities are discovered to improve performance and reduce false positives. To detect leaked credentials, see Leaked Credentials Check.
WAFv2 rulesets include:
- eCDN Managed Ruleset
- OWASP Managed Ruleset
Business Manager supports eCDN configuration of WAFv2 settings specific to each instance (Development, Staging, Production), for managing instances individually. When you set or update WAFv2, these changes are not replicated to other instances. This approach simplifies testing and deploying WAFv2 security settings from development and staging to production during transitions.
Ruleset ID: efb7b8c949ac4650a09736fc376e9aee
Created by the eCDN security team, this ruleset provides fast and effective protection for all of your applications. By default, some rules in the ruleset are disabled or set to log by default, to balance providing the right protection with reducing the number of false positives.
Configure the following settings for this ruleset:
- Action:
default,block,log,managed_challenge,js_challenge,legacy_captcha
- Enabled:
true,false
Ruleset ID: 4814384a9e5d4991b9815dcfc25d2f1f
The OWASP Managed Ruleset is an implementation of the OWASP ModSecurity Core Rule Set (CRS). This ruleset is routinely monitored for OWASP updates, based on the latest version available from the official code repository. The OWASP Managed Ruleset is designed to work as a single entity to calculate a threat score and execute an action based on that score. Individual rules in the OWASP Managed Ruleset do not have their own default action. The ruleset’s action is what is executed if the calculated threat score exceeds the score threshold.
The paranoia level (PL) classifies OWASP rules according to their aggressiveness. Available paranoia levels include:
- PL1
- PL2
- PL3
- PL4 (most aggressive)
Rules associated with higher paranoia levels are considered more aggressive and provide increased protection. However, they can cause legitimate traffic to get blocked due to false positives. When you configure the paranoia level of the OWASP Managed Ruleset, you are enabling all the rules belonging to all paranoia levels up to the level you select. For example, if you configure the ruleset paranoia level to PL3, you are enabling rules belonging to paranoia levels PL1, PL2, and PL3.
Each OWASP rule that matches the current request has an associated score. The request threat score is the sum of the individual scores of all OWASP rules that matched the request.
The anomaly score threshold (or anomaly score) defines the minimum cumulative score, which is obtained from matching OWASP rules, for the WAF to apply the configured OWASP Managed Ruleset action.
Available score thresholds:
- Low: 60 and higher
- Medium: 40 and higher (recommended default value)
- High: 25 and higher
Configure the following settings for this ruleset:
- Action
block,log,managed_challenge,js_challenge,legacy_captcha
- Paranoia Level
1,2,3,4
- Anomaly Score
low,medium,high
- Enabled
true,false
Leaked Credentials Check is enabled on all zones. You don’t have to turn anything on. It replaces the legacy Exposed Credentials Check Ruleset.
Leaked Credentials Check only detects. It doesn’t challenge or block requests on its own. To act on a detection, create a custom rule or rate-limiting rule in the Business Manager expression editor that uses the leaked-credential fields, such as cf.waf.auth_detected and cf.waf.credential_check.*. Start the rule in log mode, review the matches, and then change the action.
For example, to log login requests that submit a username and password pair found in a known leak, create a custom rule with this expression and the log action:
For more custom rule examples, see eCDN Custom Rules. For rate limiting, see eCDN Rate Limiting Rules. For field details, see Leaked credentials detection in the Cloudflare documentation.
Configuring a managed ruleset can be done via both Business Manager and CDN-API.
When updating the ruleset’s action, selecting an action other than default overrides the action of all managed rules in the ruleset. For example, by default, some rules in the eCDN Managed Ruleset are set to block while others are set to log. If you update the action of the eCDN Managed Ruleset to block, then all rules in the ruleset are set to block. If you wish to change the action of a particular managed rule, set an individual rule override.
Similarly, some rules in each managed ruleset are disabled by default. Disabling the entire ruleset will disable all managed rules in the ruleset. However, enabling a ruleset will not enable all rules in the ruleset. Enabling a ruleset maintains each rule’s default status. If you wish to update a rule’s default status, set an individual rule override.
- Navigate to Embedded CDN Settings. Locate the zone you want to update and navigate to the WAF tab. Verify the zone is using WAFv2.
- Update the WAFv2 ruleset settings as needed using the checkboxes and drop-down menus.
- Use getWafManagedRulesets to retrieve the WAFv2 managed rulesets and their current configurations by providing the zone ID.
Sample Success Response (200 HttpStatus Code):
- Use updateWafManagedRuleset to configure the desired ruleset by providing the zone and ruleset ID. You must provide at least one field in the request body.
Sample Success Response (200 HttpStatus Code):
Configuring individual managed rule overrides must be done using CDN-API.
If you see false positives due to a particular managed rule, configure overrides to adjust the rule’s action or default enabled status. Individual managed rule overrides let you fine-tune your zone’s WAFv2 configuration beyond the available ruleset-level settings.
- Use getWafManagedRulesInRuleset to view all of the rules in a particular managed ruleset by providing the zone and ruleset ID. The response will show the current configuration of each rule, taking into consideration the ruleset’s current action and enabled status. The response will also display the rule’s associated tags (such as
wordpress) which are useful when searching for a specific group of rules.
Sample Success Response (200 HttpStatus Code):
- Use updateWafManagedRuleInRuleset to configure a rule override by providing the zone, ruleset, and rule ID. You must provide at least one field in the request body.
Configure the following settings when updating a managed rule:
- Action:
default,block,log,managed_challenge,js_challenge,legacy_captcha- The
defaultaction will reset any existing action overrides and set the rule back to its default action. - The action field is only applicable for the eCDN Managed Ruleset. Setting an action override is not applicable for the OWASP Managed Ruleset because it operates by calculating a total threat score and then applying the overall ruleset’s action.
- Enabled:
true,false
Sample Success Response (200 HttpStatus Code):
- For immediate impact relief, set the ruleset to
log. - For visibility into WAFv2 firewall events, review WAF logs with an OCAPI call, the Business Manager UI, or eCDN Logpush with the
logTypeset tofirewall_events. You can view logs of firewall events in your zone and get insights into which ruleset and rule(s) are causing the false positives. After you identify the problematic managed rule, use the updateWafManagedRuleInRuleset CDN-API endpoint to override the rule’s action or disable the rule completely. - If you are seeing false positives originating from the OWASP Managed Ruleset, adjust the ruleset’s paranoia level and score threshold.
- You can create a custom rule with the
skip_wafv2action to have particular requests skip WAFv2 completely. Any traffic matching the rule expression is not evaluated by WAFv2.