默认记录WAF的条件从检测到攻击改为所有匹配WAF规则集的请求

This commit is contained in:
GoEdgeLab
2022-04-21 19:02:17 +08:00
parent e9055a6b60
commit 21329e0d28

View File

@@ -206,6 +206,10 @@ func (this *HTTPRequest) checkWAFRequest(firewallPolicy *firewallconfigs.HTTPFir
}
if ruleSet != nil {
if firewallPolicy.Log != nil && firewallPolicy.Log.IsOn {
this.forceLog = true
}
if ruleSet.HasSpecialActions() {
this.firewallPolicyId = firewallPolicy.Id
this.firewallRuleGroupId = types.Int64(ruleGroup.Id)
@@ -213,9 +217,6 @@ func (this *HTTPRequest) checkWAFRequest(firewallPolicy *firewallconfigs.HTTPFir
if ruleSet.HasAttackActions() {
this.isAttack = true
if firewallPolicy.Log != nil && firewallPolicy.Log.IsOn {
this.forceLog = true
}
}
// 添加统计
@@ -271,6 +272,10 @@ func (this *HTTPRequest) checkWAFResponse(firewallPolicy *firewallconfigs.HTTPFi
}
if ruleSet != nil {
if firewallPolicy.Log != nil && firewallPolicy.Log.IsOn {
this.forceLog = true
}
if ruleSet.HasSpecialActions() {
this.firewallPolicyId = firewallPolicy.Id
this.firewallRuleGroupId = types.Int64(ruleGroup.Id)
@@ -278,9 +283,6 @@ func (this *HTTPRequest) checkWAFResponse(firewallPolicy *firewallconfigs.HTTPFi
if ruleSet.HasAttackActions() {
this.isAttack = true
if firewallPolicy.Log != nil && firewallPolicy.Log.IsOn {
this.forceLog = true
}
}
// 添加统计