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/waf/detections/leaked-credentials/get-started.mdx
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,20 +90,18 @@ To check for leaked credentials in a way that is not covered by the default conf
90
90
91
91
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
92
92
2. Go to **Security** > **Settings**.
93
-
3. Under **Incoming traffic detections**, select **Leaked credentials** and then select the three dots to add a custom detection.
94
-
4. In **Username location**, enter an expression for obtaining the username in the HTTP request. For example:
93
+
3. Under **Incoming traffic detections**, select **Leaked credentials** and then select **Add custom username and password location**.
94
+
4. In **Username location** and **Password location** (optional), enter expressions for obtaining the username and the password from the HTTP request. Refer to the following example expressions:
95
95
96
-
```txt
97
-
lookup_json_string(http.request.body.raw, "user")
98
-
```
96
+
| Request type | Username location / Password location |
| JSON body |`lookup_json_string(http.request.body.raw, "user")`<br/>`lookup_json_string(http.request.body.raw, "secret")`|
99
+
| URL-encoded form |`url_decode(http.request.body.form["user"][0])`<br/>`url_decode(http.request.body.form["secret"][0])`|
100
+
| Multipart form |`url_decode(http.request.body.multipart["user"][0])`<br/>`url_decode(http.request.body.multipart["secret"][0])`|
99
101
100
-
5. In **Password location**, enter an expression for obtaining the password in the HTTP request. For example:
102
+
Refer to the [`lookup_json_string()`](/ruleset-engine/rules-language/functions/#lookup_json_string) and [`url_decode()`](/ruleset-engine/rules-language/functions/#url_decode) documentation for more information on these functions.
@@ -126,6 +124,8 @@ This pair of lookup expressions (for username and password) will scan incoming H
126
124
{"user":"<username>", "secret":"<password>"}
127
125
```
128
126
127
+
Refer to the [`lookup_json_string()`](/ruleset-engine/rules-language/functions/#lookup_json_string) documentation for more information on this function.
128
+
129
129
</TabItem> </Tabs>
130
130
131
131
You only need to provide an expression for the username in custom detection locations.
0 commit comments