feat(waf): 新增 UA 检查节点 ua_check

支持要求携带 UA、浏览器/OS 白名单 and-or 匹配,以及优先屏蔽爬虫与非正常 UA。
This commit is contained in:
ryan
2026-07-19 11:35:31 +08:00
parent 047ed6554d
commit 28eef0bbcd
22 changed files with 643 additions and 15 deletions
+16
View File
@@ -779,6 +779,15 @@ export interface BlockNodeConfig {
response_body: string;
}
export interface UACheckConfig {
require_ua: boolean;
browsers: string[];
operating_systems: string[];
match_mode: 'and' | 'or';
block_common_bots: boolean;
block_abnormal_ua: boolean;
}
export type WAFRuleNode =
| {
id: string;
@@ -801,6 +810,13 @@ export type WAFRuleNode =
position: XYPosition;
config: GeoMatchConfig;
}
| {
id: string;
type: 'ua_check';
label?: string;
position: XYPosition;
config: UACheckConfig;
}
| {
id: string;
type: 'pow';