-
Notifications
You must be signed in to change notification settings - Fork 10k
[WAF] Update managed rules troubleshooting #24670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9d5e1a3
Update managed rules troubleshooting
pedrosousa 0cea5d9
Small fix
pedrosousa d7a60fa
Update list structure in troubleshoot false negatives
pedrosousa d8de695
Several updates
pedrosousa 7a0aead
Update content type
pedrosousa 664dd11
Update link
pedrosousa 931af27
Add line break
pedrosousa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
src/content/docs/waf/managed-rules/handle-false-positives.mdx
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| --- | ||
| pcx_content_type: troubleshooting | ||
| title: Troubleshoot managed rules | ||
| sidebar: | ||
| order: 4 | ||
| label: Troubleshooting | ||
| --- | ||
|
|
||
| import { RuleID } from "~/components"; | ||
|
|
||
| By default, WAF's managed rulesets are compatible with most websites and web applications. However, false positives and false negatives may occur: | ||
|
|
||
| - **False positives**: Legitimate requests detected and mitigated as malicious. | ||
| - **False negatives**: Malicious requests that were not mitigated and reached your origin server. | ||
|
|
||
| ## Troubleshoot false positives | ||
|
|
||
| You can use [Security Events](/waf/analytics/security-events/) to help you identify what caused legitimate requests to get blocked. Add filters and adjust the report duration as needed. | ||
|
|
||
| If you encounter a false positive caused by a managed rule, do one of the following: | ||
|
|
||
| - **Add an exception**: [Exceptions](/waf/managed-rules/waf-exceptions/) allow you to skip the execution of WAF managed rulesets or some of their rules for certain requests. | ||
|
|
||
| - **Adjust the OWASP managed ruleset**: A request blocked by the rule with ID <RuleID id="6179ae15870a4bb7b2d480d4843b323c" /> and description `949110: Inbound Anomaly Score Exceeded` refers to the [Cloudflare OWASP Core Ruleset](/waf/managed-rules/reference/owasp-core-ruleset/). To resolve the issue, [configure the OWASP managed ruleset](/waf/managed-rules/reference/owasp-core-ruleset/configure-dashboard/). | ||
|
|
||
| - **Disable the corresponding managed rule(s)**: Create an override to disable specific rules. This may avoid false positives, but you will also reduce the overall site security. Refer to the [dashboard instructions](/waf/managed-rules/deploy-zone-dashboard/#configure-a-managed-ruleset) on configuring a managed ruleset, or to the [API instructions](/ruleset-engine/managed-rulesets/override-managed-ruleset/) on creating an override. | ||
|
|
||
| :::note | ||
| If you contact Cloudflare Support to verify whether a WAF managed rule triggers as expected, [provide a HAR file](/support/troubleshooting/general-troubleshooting/gathering-information-for-troubleshooting-sites/#generate-a-har-file) captured while sending the specific request of concern. | ||
| ::: | ||
|
|
||
| ### Additional recommendations | ||
|
|
||
| - If one specific rule causes false positives, disable that specific rule and not the entire ruleset. | ||
|
|
||
| - For false positives with the administrator area of your website, add an [exception](/waf/managed-rules/waf-exceptions/) disabling a managed rule for the admin section of your site resources. You can use an expression similar to the following: | ||
|
|
||
| `http.host eq "example.com" and starts_with(http.request.uri.path, "/admin")` | ||
|
|
||
| ## Troubleshoot false negatives | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New content, based on the troubleshooting page for a previous implementation: https://developers.cloudflare.com/waf/reference/legacy/old-waf-managed-rules/troubleshooting/#troubleshoot-false-negatives. |
||
|
|
||
| To identify false negatives, review the HTTP logs on your origin server. To reduce false negatives, use the following checklist: | ||
pedrosousa marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - Are DNS records that serve HTTP traffic [proxied through Cloudflare](/dns/proxy-status/)?<br/> | ||
| Cloudflare only mitigates requests in proxied traffic. | ||
|
|
||
| - Have you deployed any of the [WAF managed rulesets](/waf/managed-rules/#available-managed-rulesets) in your zone?<br/> | ||
| You must [deploy a managed ruleset](/waf/managed-rules/deploy-zone-dashboard/#deploy-a-managed-ruleset) to apply its rules. | ||
|
|
||
| - Are Managed Rules being skipped via an [exception](/waf/managed-rules/waf-exceptions/)?<br/> | ||
| Use [Security Events](/waf/analytics/security-events/) to search for requests being skipped. If necessary, adjust the exception expression so that it matches the attack traffic that should have been blocked. | ||
|
|
||
| - Have you enabled any necessary managed rules that are not enabled by default?<br/> | ||
| Not all rules of WAF managed rulesets are enabled by default, so you should review individual managed rules. | ||
| - For example, Cloudflare allows requests with empty user agents by default. To block requests with an empty user agent, enable the rule with ID <RuleID id="b57df4f17f7f4ea4b8db33e20a6dbbd3"/> in the Cloudflare Managed Ruleset. | ||
| - Another example: If you want to block unmitigated SQL injection (SQLi) attacks, make sure the relevant managed rules tagged with `sqli` are enabled in the Cloudflare Managed Ruleset. | ||
|
|
||
| For instructions, refer to [Configure a managed ruleset](/waf/managed-rules/deploy-zone-dashboard/#configure-a-managed-ruleset). | ||
|
|
||
| - Is the attack traffic matching a custom rule [skipping all Managed Rules](/waf/custom-rules/skip/)?<br/> | ||
| If necessary, adjust the custom rule expression so that it does not apply to the attack traffic. | ||
|
|
||
| - Is the attack traffic matching an allowed ASN, IP range, or IP address in [IP Access rules](/waf/tools/ip-access-rules/)?<br/> | ||
| Review your IP Access rules and make sure that any allow rules do not match the attack traffic. | ||
|
|
||
| - Is the malicious traffic reaching your origin IP addresses directly, therefore bypassing Cloudflare protection?<br/> | ||
| Block all traffic except from [Cloudflare's IP addresses](/fundamentals/concepts/cloudflare-ip-addresses/) at your origin server. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content below this point about false positives already existed (you can skip it while reviewing).