Skip to content

Commit d977bab

Browse files
[Use Cases] Replace unverified user_agent expressions with source-verified fields (cf.client.bot, method, path)
1 parent 8c4903c commit d977bab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/content/docs/use-cases/application-security/bots/stop-malicious-bots.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ This ensures verified bots (search engine crawlers, monitoring services) bypass
217217

218218
1. Select **Create rule**.
219219
2. Enter a descriptive name in **Rule name**.
220-
3. Under **When incoming requests match**, select **Edit expression** and enter: `(http.request.uri.path eq "/login" and http.user_agent eq "")`
220+
3. Under **When incoming requests match**, select **Edit expression** and enter: `(http.request.uri.path eq "/login" and http.request.method eq "POST")`
221221
4. Under **Then take action**, select _Managed Challenge_ from the **Choose action** dropdown.
222222
5. Under **Place at**, leave the **Select order** dropdown set to _Last_. This places the rule after the verified bot exception.
223223
6. Select **Deploy**.
@@ -317,15 +317,15 @@ For details on Skip action configuration, refer to [Configure a rule with the Sk
317317

318318
**Scenario 2: Malicious traffic is still getting through.**
319319

320-
You see bot activity in Security Events that your current rules do not catch. Bots that use real-looking headers or stay under rate limits can evade single-signal rules. Combining multiple signals in one rule narrows the target. For example, to challenge requests to `/login` that have both an empty user agent and a specific URI path:
320+
You see bot activity in Security Events that your current rules do not catch. Bots that stay under rate limits or evade single-signal rules require combining multiple signals. For example, to challenge POST requests to `/login` that are not from verified bots:
321321

322322
1. Go to Application Security custom rules.
323323
2. Select **Create rule**.
324324
3. Enter a descriptive name.
325325
4. Under **When incoming requests match**, select **Edit expression** and enter:
326326

327327
```txt
328-
(http.request.uri.path eq "/login" and http.user_agent eq "" and http.request.method eq "POST")
328+
(http.request.uri.path eq "/login" and http.request.method eq "POST" and not cf.client.bot)
329329
```
330330

331331
5. Under **Then take action**, select _Managed Challenge_.

0 commit comments

Comments
 (0)