mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2026-01-04 22:55:48 +08:00
将WAF模板中的cc修改为cc2
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/iwind/TeaGo/lists"
|
||||
"github.com/iwind/TeaGo/logs"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"github.com/iwind/TeaGo/utils/string"
|
||||
"net/http"
|
||||
@@ -127,7 +126,6 @@ func (this *RuleSet) PerformActions(waf *WAF, group *RuleGroup, req requests.Req
|
||||
return false
|
||||
}
|
||||
}
|
||||
logs.Printf("perform1: %#v", instance) // TODO
|
||||
instance.Perform(waf, group, this, req, writer)
|
||||
}
|
||||
}
|
||||
@@ -142,7 +140,6 @@ func (this *RuleSet) PerformActions(waf *WAF, group *RuleGroup, req requests.Req
|
||||
return false
|
||||
}
|
||||
}
|
||||
logs.Printf("perform2: %#v", instance) // TODO
|
||||
return instance.Perform(waf, group, this, req, writer)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ func Template() *WAF {
|
||||
group.IsInbound = true
|
||||
group.Name = "CC攻击"
|
||||
group.Description = "Challenge Collapsar,防止短时间大量请求涌入,请谨慎开启和设置"
|
||||
group.Code = "cc"
|
||||
group.Code = "cc2"
|
||||
|
||||
{
|
||||
set := NewRuleSet()
|
||||
@@ -378,11 +378,13 @@ func Template() *WAF {
|
||||
set.Connector = RuleConnectorAnd
|
||||
set.AddAction(ActionBlock, nil)
|
||||
set.AddRule(&Rule{
|
||||
Param: "${cc.requests}",
|
||||
Param: "${cc2}",
|
||||
Operator: RuleOperatorGt,
|
||||
Value: "1000",
|
||||
CheckpointOptions: map[string]interface{}{
|
||||
"period": "60",
|
||||
"period": "60",
|
||||
"threshold": 1000,
|
||||
"keys": []string{"${remoteAddr}", "${requestPath}"},
|
||||
},
|
||||
IsCaseInsensitive: false,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user