mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-12 19:30:25 +08:00
WAF模板--爬虫工具增加白名单
This commit is contained in:
@@ -446,7 +446,7 @@ func HTTPFirewallTemplate() *HTTPFirewallPolicy {
|
|||||||
set.IsOn = true
|
set.IsOn = true
|
||||||
set.Name = "爬虫工具"
|
set.Name = "爬虫工具"
|
||||||
set.Code = "20003"
|
set.Code = "20003"
|
||||||
set.Connector = HTTPFirewallRuleConnectorOr
|
set.Connector = HTTPFirewallRuleConnectorAnd
|
||||||
set.Actions = []*HTTPFirewallActionConfig{
|
set.Actions = []*HTTPFirewallActionConfig{
|
||||||
{
|
{
|
||||||
Code: HTTPFirewallActionBlock,
|
Code: HTTPFirewallActionBlock,
|
||||||
@@ -460,6 +460,14 @@ func HTTPFirewallTemplate() *HTTPFirewallPolicy {
|
|||||||
Value: `python|pycurl|http-client|httpclient|apachebench|nethttp|http_request|java|perl|ruby|scrapy|php|rust`,
|
Value: `python|pycurl|http-client|httpclient|apachebench|nethttp|http_request|java|perl|ruby|scrapy|php|rust`,
|
||||||
IsCaseInsensitive: true,
|
IsCaseInsensitive: true,
|
||||||
})
|
})
|
||||||
|
set.AddRule(&HTTPFirewallRule{
|
||||||
|
IsOn: true,
|
||||||
|
Param: "${userAgent}",
|
||||||
|
Operator: HTTPFirewallRuleOperatorNotMatch,
|
||||||
|
Value: `goedge`,
|
||||||
|
IsCaseInsensitive: true,
|
||||||
|
Description: "User-Agent白名单",
|
||||||
|
})
|
||||||
|
|
||||||
group.AddRuleSet(set)
|
group.AddRuleSet(set)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user