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
You can include the encrypted matched payload in your [Logpush](/logs/about/) jobs by adding the **General** > [**Metadata**](/logs/reference/log-fields/zone/firewall_events/#metadata) field from the Firewall Events dataset to your job.
12
11
13
-
The payload, in its encrypted form, is available in the `encrypted_matched_data` property of the `Metadata` field.
12
+
The payload, in its encrypted form, is available in the [`encrypted_matched_data` property](#structure-of-encrypted_matched_data-property-in-logpush) of the `Metadata` field.
14
13
15
14
However, you may want to decrypt the matched payload before storing the logs in your <GlossaryTooltipterm="SIEM">SIEM system</GlossaryTooltip> of choice. Cloudflare provides a [sample Worker project](https://github.com/cloudflare/matched-data-worker) on GitHub that does the following:
16
15
@@ -21,3 +20,65 @@ However, you may want to decrypt the matched payload before storing the logs in
21
20
You will need to make some changes to the sample project to push the logs containing decrypted payload data to your log storage system.
22
21
23
22
Refer to the Worker project's [README](https://github.com/cloudflare/matched-data-worker/blob/main/README.md) for more information on configuring and deploying this Worker project.
23
+
24
+
## Structure of `encrypted_matched_data` property in Logpush
25
+
26
+
Matched payload information includes the specific string that triggered a rule, along with some text that appears immediately before and after the matched string.
27
+
28
+
Once you decrypt its value, the `encrypted_matched_data` property of the `Metadata` field in Logpush has a structure similar to the following:
29
+
30
+
```json
31
+
{
32
+
// for fields with only one match (such as URI or user agent fields):
33
+
"<match_location>": {
34
+
"before": "<text_before_match>",
35
+
"content": "<matched_text>",
36
+
"after": "<text_after_match>"
37
+
},
38
+
// for fields with possible multiple matches (such as form, header, or body fields):
39
+
"<match_location>": [
40
+
{
41
+
"before": "<text_before_match_1>",
42
+
"content": "<matched_text_1>",
43
+
"after": "<text_after_match_1>"
44
+
},
45
+
{
46
+
"before": "<text_before_match_2>",
47
+
"content": "<matched_text_2>",
48
+
"after": "<text_after_match_2>"
49
+
}
50
+
]
51
+
}
52
+
```
53
+
54
+
The `before` and `after` properties are optional (there may be no content before/after the matched text) and will contain at most 15 bytes of content appearing before and after the match.
55
+
56
+
Below are a few examples of payload matches:
57
+
58
+
```json title="URI match"
59
+
{
60
+
"http.request.uri": {
61
+
"before": "/admin",
62
+
"content": "/.git/",
63
+
"after": "config"
64
+
}
65
+
}
66
+
```
67
+
68
+
```json title="Header value match"
69
+
{
70
+
"http.request.headers.values[3]": [
71
+
{ "content": "phar://", "after": "example" }
72
+
]
73
+
}
74
+
```
75
+
76
+
```json title="Raw body content match"
77
+
{
78
+
"http.request.body.raw": {
79
+
"before": "NY>",
80
+
"content": "<!ENTITY xxe SYSTEM \"file:///dev/random\">] > ",
Copy file name to clipboardExpand all lines: src/content/docs/waf/managed-rules/payload-logging/index.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,12 @@ sidebar:
7
7
8
8
import { GlossaryTooltip } from"~/components";
9
9
10
-
The WAF allows you to log the request information that triggered a specific rule of a managed ruleset. This information is known as the payload. Payload logging is especially useful when diagnosing the behavior of WAF rules. Since the values that triggered a rule may contain sensitive data, they are encrypted with a customer-provided public key so that only you can examine them later.
10
+
The WAF allows you to log the request information that triggered a specific rule of a managed ruleset. This information is known as the payload. Payload information includes the specific string that triggered the rule, along with the text that appears immediately before and after the match.
11
11
12
-
:::note
12
+
Payload logging is especially useful when diagnosing the behavior of WAF rules. Since the values that triggered a rule may contain sensitive data, they are encrypted with a customer-provided public key so that only you can examine them later.
13
13
14
+
:::note
14
15
This feature is only available for customers on an Enterprise plan.
Copy file name to clipboardExpand all lines: src/content/docs/waf/managed-rules/payload-logging/view.mdx
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,18 +11,16 @@ View the content of the matched rule payload in the dashboard by entering your p
11
11
12
12
2. Under **Sampled logs**, expand the details of an event triggered by a rule whose managed ruleset has payload logging enabled.
13
13
14
-
3. Under **Payload match**, select **Decrypt payload log**.
14
+
3. Under **Matched service**, select **Decrypt payload match**.
15
15
16
16

17
17
18
-
The **Payload match** section is not available if the action taken by the matched rule is _Log_.
19
-
20
18
4. Enter your private key in the pop-up window and select **Decrypt**.
21
19
22
20
:::note
23
21
The private key is not sent to a Cloudflare server. The decryption occurs entirely in the browser.
24
22
:::
25
23
26
-
If the private key you entered decrypts the encrypted payload successfully, the **Payload match** card displays the payload content in clear text.
24
+
If the private key you entered decrypts the encrypted payload successfully, the dashboard will show the name of the fields that matched and the matched string in clear text, along with some text appearing before and after the match.
27
25
28
26

0 commit comments