You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/ruleset-engine/rules-language/fields/dynamic-fields.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -436,25 +436,25 @@ For more details, refer to [Malicious uploads detection](/waf/detections/malicio
436
436
437
437
`cf.waf.score` <Typetext='Number' />
438
438
439
-
A global score from 1 to 99 that combines the score of each WAF attack vector into a single score. This is the standard [WAF attack score](/waf/detections/attack-score/) to detect variants of attack patterns.
439
+
A global score from `1` to `99` that combines the score of each WAF attack vector into a single score. This is the standard [WAF attack score](/waf/detections/attack-score/) to detect variants of attack patterns.
440
440
441
441
## `cf.waf.score.sqli`
442
442
443
443
`cf.waf.score.sqli` <Typetext='Number' />
444
444
445
-
An attack score from 1 to 99 classifying the SQL injection (SQLi) attack vector.
445
+
An attack score from `1` to `99` classifying the SQL injection (SQLi) attack vector.
446
446
447
447
## `cf.waf.score.xss`
448
448
449
449
`cf.waf.score.xss` <Typetext='Number' />
450
450
451
-
An attack score from 1 to 99 classifying the cross-site scripting (XSS) attack vector.
451
+
An attack score from `1` to `99` classifying the cross-site scripting (XSS) attack vector.
452
452
453
453
## `cf.waf.score.rce`
454
454
455
455
`cf.waf.score.rce` <Typetext='Number' />
456
456
457
-
An attack score from 1 to 99 classifying the command injection or Remote Code Execution (RCE) attack vector.
457
+
An attack score from `1` to `99` classifying the command injection or Remote Code Execution (RCE) attack vector.
You can use these fields in expressions of [custom rules](/waf/custom-rules/) and [rate limiting rules](/waf/rate-limiting-rules/) where:
35
+
You can use these fields in expressions of [custom rules](/waf/custom-rules/) and [rate limiting rules](/waf/rate-limiting-rules/). Attack score fields of data type `Number` vary between `1` and `99` with the following meaning:
36
36
37
37
- A score of `1` indicates that the request is almost certainly malicious.
38
38
- A score of `99` indicates that the request is likely clean.
39
-
- A score of `100` indicates that the Cloudflare WAF did not score the request.
40
39
41
-
The available scores are independent of each other. Namely, the WAF Attack Score is not a sum of the other scores.
40
+
The special score `100` indicates that the Cloudflare WAF did not score the request.
41
+
42
+
The global WAF Attack Score is mathematically derived from individual attack scores (for example, from SQLi Attack Score and XSS Attack Score), reflecting their interdependence. However, the global score is not a sum of individual scores. A low global score usually indicates medium to low individual scores, while a high global score suggests higher individual scores.
42
43
43
44
The WAF Attack Score Class field can have one of the following values, depending on the calculated request attack score:
44
45
@@ -49,23 +50,41 @@ The WAF Attack Score Class field can have one of the following values, depending
49
50
|_Likely clean_|`likely_clean`| Attack score between `51` and `80`. |
50
51
|_Clean_|`clean`| Attack score between `81` and `99`. |
51
52
52
-
Requests with an attack score of `100` will have a class of _Unscored_ in the Cloudflare dashboard, but you cannot use this class value in rule expressions.
53
+
Requests with the special attack score `100` will show a WAF Attack Score Class of _Unscored_ in the Cloudflare dashboard, but you cannot use this class value in rule expressions.
53
54
54
55
Attack score automatically detects and decodes Base64, JavaScript (Unicode escape sequences), and URL encoded content anywhere in the request: URL, headers, and body.
55
56
57
+
## Rule recommendations
58
+
59
+
Cloudflare does not recommend that you block traffic solely based on the WAF Attack Score for all values below `50`, since the _Likely attack_ range (scores between `21` and `50`) tends to have false positives. If you want to block traffic based on this score, do one of the following:
60
+
61
+
- Use a more strict WAF Attack Score value in your expression. For example, block traffic with a WAF attack score below `20` or below `15` (you may need to adjust the exact threshold).
62
+
63
+
- Combine a higher WAF Attack Score threshold with additional filters when blocking incoming traffic. For example, include a check for a specific URI path in your expression or use bot score as part of your criteria.
64
+
56
65
---
57
66
58
67
## Start using WAF attack score
59
68
60
69
### 1. Create a custom rule
61
70
62
-
If you are an Enterprise customer:
71
+
If you are an Enterprise customer, create a [WAF custom rule](/waf/custom-rules/create-dashboard/) that blocks requests with a **WAF Attack Score** less than or equal to 20 (recommended initial threshold). For example:
- Equivalent rule expression: `cf.waf.score le 20`
78
+
- Action: _Block_
63
79
64
-
- Create a [WAF custom rule](/waf/custom-rules/create-dashboard/) that logs all requests with a WAF Attack Score below 40 (recommended initial threshold). For example, set the rule expression to `cf.waf.score lt 40` and the rule action to _Log_.
80
+
Business customers must create a custom rulewith the **WAF Attack Score Class** field instead. For example, use this field to block incoming requests with a score class of _Attack_:
65
81
66
-
If you are a Business customer:
82
+
| Field | Operator | Value |
83
+
| ---------------------- | -------- | -------- |
84
+
| WAF Attack Score Class | equals |`Attack`|
67
85
68
-
- Create a [WAF custom rule](/waf/custom-rules/create-dashboard/) matching requests with a WAF Attack Score Class of _Attack_. For example, set the rule expression to `cf.waf.score.class eq "attack"` and the rule action to a challenge action (such as _Managed Challenge_) or _Block_.
0 commit comments