WAF策略默认开启记录日志

This commit is contained in:
GoEdgeLab
2022-04-21 09:38:56 +08:00
parent 588eda4641
commit fe7c81f663
2 changed files with 35 additions and 10 deletions

View File

@@ -14,6 +14,7 @@ type HTTPFirewallPolicy struct {
Mode FirewallMode `yaml:"mode" json:"mode"`
UseLocalFirewall bool `yaml:"useLocalFirewall" json:"useLocalFirewall"`
SYNFlood *SYNFloodConfig `yaml:"synFlood" json:"synFlood"`
Log *HTTPFirewallPolicyLogConfig `yaml:"log" json:"log"` // 强制记录日志
}
// Init 初始化
@@ -39,6 +40,13 @@ func (this *HTTPFirewallPolicy) Init() error {
}
}
if this.Log != nil {
err := this.Log.Init()
if err != nil {
return err
}
}
return nil
}

View File

@@ -0,0 +1,17 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package firewallconfigs
var DefaultHTTPFirewallPolicyLogConfig = &HTTPFirewallPolicyLogConfig{
IsOn: true,
RequestBody: true,
}
type HTTPFirewallPolicyLogConfig struct {
IsOn bool `yaml:"isOn" json:"isOn"`
RequestBody bool `yaml:"requestBody" json:"requestBody"`
}
func (this *HTTPFirewallPolicyLogConfig) Init() error {
return nil
}