Skip to content

Commit 002ccbd

Browse files
committed
[WAF] Update example expressions for leaked credentials detection
1 parent 7842121 commit 002ccbd

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/content/docs/waf/detections/leaked-credentials/get-started.mdx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,16 @@ To check for leaked credentials in a way that is not covered by the default conf
9090

9191
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
9292
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:
9595

96-
```txt
97-
lookup_json_string(http.request.body.raw, "user")
98-
```
96+
| Request type | Username location / Password location |
97+
| ---------------- | --------------------------------------------------------------------------------------------------------------------- |
98+
| JSON body | `lookup_json_string(http.request.body.raw, "username")`<br/>`lookup_json_string(http.request.body.raw, "password")` |
99+
| URL-encoded form | `url_decode(http.request.body.form["username"][0])`<br/>`url_decode(http.request.body.form["password"][0])` |
100+
| Multipart form | `url_decode(http.request.body.multipart["username"][0])`<br/>`url_decode(http.request.body.multipart["password"][0])` |
99101

100-
5. In **Password location**, enter an expression for obtaining the password in the HTTP request. For example:
101-
102-
```txt
103-
lookup_json_string(http.request.body.raw, "secret")
104-
```
105-
106-
6. Select **Save**.
102+
5. Select **Save**.
107103

108104
</TabItem> <TabItem label="API">
109105

0 commit comments

Comments
 (0)