tencent cloud

Web Application Firewall

BOT Scenario-Based Practice Tutorial

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-11-10 10:10:56
AI 번역 및 품질 검수 완료

Feature Introduction

In BOT management, you can enable and configure the corresponding modules, and observe and analyze them in conjunction with BOT traffic and access logs. Configure refined policies based on the session status information provided by traffic analysis to protect core website APIs and business operations from BOT attacks.
BOT management settings support configuring BOT scenario types, browser bot defense, threat intelligence, AI policies, smart statistics, action policies, custom rules, session management, and good bots modules, enabling refined BOT management through these configurations. The BOT practice tutorial flowchart is shown below:
Note:
This document focuses on operational steps and case analysis. For the prerequisites, feature principles, global configuration methods, and false positive risk descriptions of each module, see Overview and Protection Modules.


Configuration Guide for Typical Scenarios

The following lists several common business protection requirements and recommended configuration approaches.

Flash Sale/Rush Purchase Protection

Scenario: During major promotions, scripts place orders in batches and scalpers hoard goods, preventing normal users from participating fairly.
Configuration approach:
1. Create a BOT scenario and select Flash sales as the business scenario type. The system will automatically generate the corresponding basic rules.
2. Enable Browser Bot Defense, and first observe the matched traffic in monitoring mode. Switch to blocking only after confirming that all matched traffic consists of script requests.
3. Enable Smart Statistics (intelligent recommendation mode) to automatically identify high-frequency abnormal access.
4. Configure Session Management to distinguish different users under the same IP address by the user identifier in the Cookie (scalpers often use proxy IP address pools to bypass IP address-based restrictions).
5. Configure Action Policies: set high-score requests to Block and medium-score requests to Human-Computer Verification.

Content Anti-Crawling

Scenario: Competitors use automated tools to crawl core data such as product prices and copy content in batches.
Configuration approach:
1. Create a BOT scenario and select Content Anti-Crawling Scene as the business scenario type.
2. Enable Browser Bot Defense and turn on page anti-debugging and automated tool detection to block automated requests made through headless browsers, curl, and similar methods.
3. Enable Threat Intelligence to block IDC-originated and malicious proxy IP addresses.
4. Enable the AI Policies to identify advanced crawlers that simulate browser behavior.
5. If any traffic still slips through, extract abnormal characteristics in BOT Traffic and configure Custom Rules for precise blocking.

Credential Stuffing/Account Security

Scenario: Attackers use leaked account password databases to attempt logins in batches and hijack user accounts.
Configuration approach:
1. Create a BOT scenario and select Login as the business scenario type.
2. Enable Threat Intelligence to block known malicious IP address ranges and IDC-originated traffic.
3. Enable Smart Statistics to identify high-frequency login attempts.
4. Configure Session Management to distinguish the login behaviors of different users under the same IP address.
5. Configure Action Policies: set abnormal login requests to Human-Computer Verification first, and then switch to Block after malicious intent is confirmed.
Attention:
When the modules for the above scenarios are launched, it is recommended to first observe the matched traffic in monitoring mode, and switch to blocking only after confirming that normal business is not affected. For details on the risk of false positives, see Overview.

Creating a BOT Scenario

This feature leverages Tencent's years of expert experience in BOT management. It is configured based on expert experience across dimensions such as browser bot defense, threat intelligence, AI policies, smart statistics, action policies, session management, good bots, and custom rules for common BOT scenarios such as flash sales, content scraping/copying, and login. It solves the problem of difficult configuration for customers, making it simple, easy to use, and quick to get started.
1. Log in to the WAF console and choose BOT Management > BOT Rule Configuration in the left sidebar.
2. On the BOT Rule Configuration page, select the domain to protect in the upper-left corner, and click BOT Protection.
3. On the BOT protection page, click Create Scene.
4. In the New Scenario dialog box, configure the relevant parameters and click Create.
Attention:
Selecting any one of the flash sale, login, or content scraping/copying scenarios is mutually exclusive with the custom scenario.
After you select a scenario, custom rules for protecting the corresponding business scenario will be automatically generated. The rules are in Observation mode by default, and you can switch them to Block mode after observing the matched traffic.
Parameter description:
Custom scene name: Enter a name for the scenario. The name cannot exceed 50 characters.
Scene type: You can select one or more system preset scenarios, or select a custom scenario. Preset scenarios (whether selected individually or in combination) are mutually exclusive with the custom scenario and cannot be enabled at the same time.
Select the default enabled rule set: The system selects the rule set for the corresponding scenario by default, and the default action is Monitor. It is recommended to enable all rule sets to identify more types of BOTs and improve the default protection capability.
Client type: The client type that accesses the protected target. Only browser/H5 types support enabling browser bot defense.
Priority: The execution priority of this scenario. Enter an integer from 1 to 100. A smaller value indicates a higher priority.
Scope: The effective scope of this scenario under the current domain. It supports both the entire domain and custom scopes.
5. In the scenario management list, the created scenario card data will appear, and you can then configure it further.

Session Management

By configuring this feature to specify the location of the session Token, users can distinguish and identify the access behaviors of different users under the same IP address. This enables precise handling of users with abnormal access behaviors without affecting other users.
1. Log in to the WAF console and choose BOT Management > BOT Rule Configuration.
2. On the BOT Rule Configuration page, select the domain to protect in the upper-left corner, and click BOT Management.
3. In Global Settings, click Configure now in the session management module.
4. On the session identifier configuration page, click Add Policy, configure the relevant parameters, and then click OK.
Note:
The session identifier should be a persistent record tokenid, such as the value of set-cookies after login.
Field Name
Description
Session Identifier Location
Specify the parameter name in a specific location (QUERY, BODY, COOKIE, or HEADERS) as the session identifier, and use the value corresponding to that parameter name as the session ID.
Session Identifier Parameter
Value identifier. Use the . character to separate parameters at each level. Example:
test: Identifies the value of the test parameter in a JSON string as the session ID.
test1.test2: Identifies the value of the test2 parameter contained in test1 within a JSON string as the session ID.
Except for HEADERS, all other configurations are case-sensitive.
Advanced Settings
Click Advanced settings to configure. If not specifically set, the settings are applied to all scenarios by default with a priority of 1.
Application scenarios: It supports selecting All scenes or Some scenarios, and the rules take effect on the selected scenarios.
Priority: Enter an integer from 1 to 100. A smaller value indicates a higher priority, and the corresponding session identifier is matched first. If priorities are the same, the most recently updated one takes precedence.

Browser Bot Defense

For the working principles and global configuration methods of browser bot defense, see Protection Module. The following describes how to enable browser bot defense in scenarios through practical examples.

Case 1: Automated Script Requests from a Large Number of Machines

When there are a large number of automated script requests to the service, access requests from tools such as CURL, SOAPUI, JMETER, and POSTMAN are blocked.
1. Log in to the WAF console and choose BOT Management > BOT Rule Configuration in the left sidebar.
2. On the BOT Rule Configuration page, select the domain to protect in the upper-left corner, and click BOT Management.
3. In Global Settings, click Configure now in the browser bot defense module.
4. Click the

identified by the automated tool to confirm the allowlist.
5. In Scenario Management, select the target scenario, and then click Details on the right.

6. On the scenario details page, click the

of the browser bot defense module in this scenario, select Block as the protection mode, and enable the browser bot defense feature.

7. The request results using CURL, SELENIUM, and POSTMAN are shown below:
CURL

SELENIUM

POSTMAN


Case 2: Disabling Web Page Debugging

Disable web debugging for users to prevent the development of targeted crawlers.
1. Log in to the WAF console and choose BOT Management > BOT Rule Configuration in the left sidebar.
2. On the BOT Rule Configuration page, select the domain to protect in the upper-left corner, and click BOT Management.
3. In Global Settings, click Configure now in the browser bot defense module.
4. Click the

for Webpage anti-debugging, then confirm the allowlist.
5. In Scenario Management, select the target scenario, and then click Details on the right.

6. On the scenario details page, click the

of the browser bot defense module in this scenario, select Block as the protection mode, and enable the browser bot defense feature.

7. The request result using Chrome is shown below:


Threat Intelligence

The Threat Intelligence feature leverages Tencent's nearly two decades of cybersecurity experience and big data intelligence. It works by assessing IP address status in real time, employing a scoring mechanism, and quantifying risk values to accurately identify access from malicious dynamic IP addresses and IDCs. Simultaneously, it intelligently identifies malicious crawler characteristics to address risky access originating from malicious crawlers, distributed crawlers, proxies, credential stuffing, and fraudulent activities.
Note:
Before enabling the Threat Intelligence feature, confirm whether the business has user access from the IDC side. If IDC traffic is confirmed, disable the IDC network identification switch in Threat Intelligence before enabling the feature.
1. Log in to the WAF console and choose BOT Management > BOT Rule Configuration in the left sidebar.
2. On the BOT Rule Configuration page, select the domain to protect in the upper-left corner, and click BOT Management.
3. In Global Settings, click Configure now in the Bot analysis module.
4. On the Threat Intelligence page, if there is IDC traffic, click Disable all for the IDC network to disable the feature.
5. If there is no IDC traffic, select the target scenario in Scenario Management, and then click Details on the right.

6. On the scenario details page, click the

of the Threat Intelligence module in this scenario to directly enable the Threat Intelligence feature.


AI Policies

The AI Policies feature leverages AI technologies and Tencent's risk control practices to transform risk control features and anti-fraud experience into an AI Policies model. It performs big data analysis and AI modeling on access traffic to rapidly identify malicious visitors and deeply hidden malicious visitors, addressing risky access behaviors from Advanced Persistent Threat BOTs and covert threat BOTs.
Note:
The AI Policies is automatically learned through AI modeling and can be enabled directly. If false evaluation occurs, add the corresponding URL to the allowlist.

Enabling AI Policies

1. Log in to the WAF console and choose BOT Management > BOT Rule Configuration in the left sidebar.
2. On the BOT Rule Configuration page, select the domain to protect in the upper-left corner, and click BOT Management.
3. In Scenario Management, select the target scenario, and then click Details on the right.

4. Toggle the AI Policies switch to enable the AI Policies.


Adding Allowlist

Background Information

On the BOT traffic details page, the request is normal but is falsely reported by AI.


Operation Step

1. Log in to the WAF console and choose BOT Management > BOT Rule Configuration in the left sidebar.
2. On the BOT Rule Configuration page, select the domain to protect in the upper-left corner, and click BOT Management.
3. In Global Settings, click Configure now in the Bot analysis module.
4. Go to the AI Policies page, click Add to allowlist, enter the name, description, and URL to be added to the allowlist, and then click OK.

Smart Statistics

The Smart Statistics feature works by performing big data analysis and statistics. It automatically classifies traffic based on user group characteristics, identifies malicious traffic with anomalies, and adjusts the malicious traffic threshold through big data analysis. This addresses risky access from regular BOTs and high-frequency BOTs. Furthermore, by automatically adjusting the statistical model, it resolves most BOT behavior bypass issues.
Note:
You can directly enable Smart Statistics, and the intelligent mode is recommended.
1. Log in to the WAF console and choose BOT Management > BOT Rule Configuration in the left sidebar.
2. On the BOT Rule Configuration page, select the domain to protect in the upper-left corner, and click BOT Management.
3. In Global Settings, click Configure now in the Bot analysis module.
4. Go to the Smart Statistics page to adjust the Smart Statistics configuration.

Action Policies

The action policy feature performs comprehensive scoring on website access requests through threat intelligence, AI policies, and smart statistics. The score ranges from 0 to 100, where a higher score indicates a higher probability of BOT activity and greater harm/pressure on the website. By intelligently identifying the risk level of access behaviors based on scores, you can configure different action policies, their effective scopes, and actions for different score segments to achieve precise interception of risky access.

Background Information

When threat intelligence, AI policies, and smart statistics flag a large volume of traffic, the default configuration cannot achieve more granular interception. In this case, you need to customize actions and analyze how to configure them.

Operation Step

1. Log in to the WAF console and choose BOT Management > BOT Traffic in the left sidebar.
2. On the BOT Traffic page, select the domain to protect in the upper-left corner, select the desired access source, and then click View Details.

3. In the Basic Session Information module on the BOT Traffic Details page, view the City and Region.

4. When your business has no traffic from a specific region, it indicates that the score for that region is abnormal. In this case, you can customize the action settings to implement more granular configurations.
5. On the BOT Rule Configuration page, select the domain to protect in the upper-left corner, and click BOT Management.
6. In Scenario Management, select the target scenario, and then click Details on the right.

7. On the scenario details page, click Add action policies in the action policy module of the scenario.

8. On the Create action policy page, configure the relevant parameters and click Save.
Parameter
Description
Action Policy Name
Describes the policy name, which cannot exceed 20 characters.
On/Off
Default effective status of an action policy after it is saved.
Scope
The effective scope of this policy supports all scopes and custom scopes.
When you select a custom range, you can enter up to 5 conditions.
You can configure the logical operator between multiple conditions as "AND" or "OR".
In a single match content, you can enter multiple values separated by carriage returns, with a maximum of 20 values. When the logical operator is Contains, Equals, Belongs To, Prefix Match, or Suffix Match, the effective logic between multiple values is OR. When the logical operator is Does Not Contain, Does Not Equal, or Does Not Belong To, the effective logic between multiple values is AND.
Priority
The execution priority of this policy. Enter an integer ranging from 1 to 100. A smaller value indicates a higher priority.
Mode
Provides four handling modes: loose, moderate, strict, and custom. Among them, loose, moderate, and strict are preset modes, corresponding to recommended classifications and handling policies for BOTs of different threat levels. Preset modes can be modified, and once modified, they become custom modes.
Score
The total score of score ranges is 0 to 100. Up to 10 entries can be added for each score range. The configured score interval is left-closed and right-open. Score ranges cannot overlap. A score interval can be left empty, and when it is empty, no handling action is performed for that score range.
Note:
The BOT score (bot_score) is a comprehensive evaluation score ranging from 0 to 100, generated by four modules: AI intelligent detection, behavioral statistical analysis, threat intelligence, and terminal feature identification. Each module is scored independently, and the final score is converted to a percentage based on the score proportion of enabled modules. A higher score indicates a greater likelihood that the request originates from an automated program.
Action
Can be set to trust, monitor, JS validation, redirect to (redirect to a specific website URL), CAPTCHA, or block.
Tag
Can be set to friendly BOT, malicious BOT, normal traffic, or suspected BOT.
Friendly BOT: A BOT that is friendly/legitimate to the website by default.
Suspicious BOT: The traffic from this source is identified as suspected BOT, but it cannot be determined whether it is harmful to the website.
Normal: The access traffic is identified as originating from a normal human.
Malicious BOT: A BOT that generates malicious traffic/unfriendly access requests to the website.

Good Bots

By configuring good bots (such as search engines and subscription bots) to properly obtain website data, the website can be indexed normally.
1. Log in to the WAF console and choose BOT Management > BOT Rule Configuration in the left sidebar.
2. On the BOT Rule Configuration page, select the domain to protect in the upper-left corner, and click BOT Management.
3. In Global Settings, click Configure now in the good bots module.
4. On the Good Bots page, you can click

to enable the corresponding feature.

Custom rule

By configuring the custom rule feature, you can precisely handle crawlers that match the behavior configuration and accurately process access requests with corresponding characteristics.
Attention:
Currently, when a BOT scenario is created, a custom rule set for the corresponding scenario has been pre-configured based on the scenario type.
The data analyzed by this feature primarily comes from BOT Traffic.
This content is for reference only and should not be used as a standard business configuration. Web crawlers are classified into many types and vary by business type.

Case Details

Currently, blocking based on action scores cannot meet the demand for more refined countermeasures. You need to configure abnormal behavior characteristics. After identifying general anomalies in BOT Traffic, click View details to view abnormal data metrics and compare them in conjunction with actual business conditions.
For example, if the URL repetition rate is 1, the number of sessions is 100/minute, or UA abuse is detected, you need to check in conjunction with your business whether there are identical requests or proxy services. If not, it indicates a malicious attack. In that case, you can view and configure interception policies by using the following methods.

Case Analysis

1. Log in to the WAF console and choose BOT Management > BOT Traffic in the left sidebar.
2. On the BOT Traffic page, select the domain to protect in the upper-left corner and the desired access source. The display shows that this IP address has a high request rate, a single URL, and belongs to the IDC type.

3. Click View Details. The basic session information shows the Average session speed and the Total sessions. You can also configure settings directly based on these conditions.

4. On the Threat intelligence module page, you can determine whether this IP address has been used by legitimate users based on the intelligence data.

5. On the Request Characteristics page, you can view request details.


Policy Syntax

1. Log in to the WAF console and choose BOT Management > BOT Rule Configuration.
2. On the BOT Rule Configuration page, select the domain to protect in the upper-left corner, and click BOT Management.
3. In Scenario Management, select the target scenario, and then click Details on the right.

4. On the scenario details page, click Add rule in the custom rule module.

5. In the Add Custom Rule window, set the URL duplication to greater than 70% (only this metric exceeded 70% during the process) and the Average session speed to greater than 500 sessions/minute based on the above analysis, and then click OK.


Captcha Parsing

When the client type is App, mini program, client, or cross-origin call, the Captcha sent by WAF cannot be parsed and recognized. As a result, when BOT traffic management sends a human-machine recognition action, the human-machine recognition Captcha cannot be parsed and displayed properly. Users cannot complete the human-machine recognition interaction. After multiple Captcha triggers, access requests from legitimate users are blocked, causing service disruption.
Therefore, when configuring the handling action as human-machine recognition, you need to make targeted modifications to the frontend/client application so that it can adapt to the relevant Captcha. For the modification guide, see Integrating WAF Captcha for Frontend-Backend Separated Sites.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백