WAF策略增加观察模式和通过模式

This commit is contained in:
刘祥超
2021-09-30 11:30:58 +08:00
parent 771d2d8013
commit 12bddc6e82
4 changed files with 16 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
package waf
import (
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
"github.com/iwind/TeaGo/lists"
@@ -117,6 +118,10 @@ func (this *RuleSet) ActionCodes() []string {
}
func (this *RuleSet) PerformActions(waf *WAF, group *RuleGroup, req requests.Request, writer http.ResponseWriter) bool {
if waf.Mode != firewallconfigs.FirewallModeDefend {
return true
}
// 先执行allow
for _, instance := range this.actionInstances {
if !instance.WillChange() {