Bot Management
import { Steps, Render, DashButton } from "~/components";
Bot Management for Enterprise is a paid add-on that provides sophisticated bot protection for your domain. Customers can identify automated traffic, take appropriate action, and view detailed analytics within the dashboard.
This Enterprise product provides the most flexibility to customers by:
- Generating a bot score of 1-99 for every request. Scores below 30 are commonly associated with bot traffic. This lets you write targeted rules instead of applying blanket actions to all detected bots.
- Allowing customers to take action on this score with WAF custom rules or
Workers. For example, you can challenge low-scoring requests on your login page while allowing them on your public blog. - Allowing customers to view this score in Bot Analytics or Logs, so you can analyze bot traffic patterns and tune your rules over time.
Enable Bot Management for Enterprise
Bot Management is automatically enabled for Enterprise zones entitled with the add-on.
1. In the Cloudflare dashboard, go to the **Security Settings** page. <DashButton url="/?to=/:account/:zone/security/settings" />
- Filter by Bot traffic.
- Go to Bot management.
- Turn Bot management on.
- Choose how your domain should respond to various types of traffic by selecting the associated edit icon.
- For more details on verified bots, refer to Verified Bots.
- For more details on supported file types, refer to Static resource protection.
- For more details on invisible code injection, refer to JavaScript detections.
- For more details on WordPress optimization, refer to Super Bot Fight Mode for WordPress.
:::note
If you are not seeing Bot Management enabled on your zone or if you still see Add Bot Management on the Cloudflare dashboard, contact your account team for the proper entitlements. :::
Setup
Cloudflare recommends that you deploy the following basic settings and customize them according to the traffic in your zone.
Enable the latest Machine Learning version
Block AI Bots
Refer to Block AI bots.
:::note You can view blocked AI bot traffic via Security Analytics. :::
Deploy custom rule templates
The Definitely Automated and Likely Automated toggles you configured in the previous step already provide baseline protection against automated traffic.
If you need additional control, such as path-specific protection, custom score thresholds, or combining bot score with other fields, Cloudflare provides rule templates to get started.
:::note Custom rules created from these templates execute before the managed rules configured in Security Settings. For more details on this execution order, refer to Security features interoperability. :::
These templates use wirefilter expression syntax. In these expressions, eq means equals, le means less than or equal to, ge means greater than or equal to, and not excludes matching traffic.
-
Definite Bots template: Targets malicious bot traffic while ignoring verified bots and routes delivering static content.
(cf.bot_management.score eq 1 and not cf.bot_management.verified_bot and not cf.bot_management.static_resource) -
Likely Bots template: Targets traffic likely to be malicious bots while ignoring verified bots and routes with static content. It may contain a small amount of non-bot traffic.
(cf.bot_management.score ge 2 and cf.bot_management.score le 29 and not cf.bot_management.verified_bot and not cf.bot_management.static_resource) -
(Optional) JavaScript detections template: You must first enable JavaScript Detections from Security Settings, then set up a managed challenge. Make sure to add a method and URI path. JavaScript detections improves security for URLs that should only expect JavaScript-enabled clients.
(not cf.bot_management.js_detection.passed and http.request.method eq "" and http.request.uri.path in {""})
谢谢你的反馈!