mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-09 00:40:24 +08:00
WAF策略默认开启记录日志
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user