WAF策略增加“最多检查内容尺寸“选项

This commit is contained in:
GoEdgeLab
2023-08-02 17:00:40 +08:00
parent 92f26b4d46
commit 5eaa396f36
4 changed files with 36 additions and 21 deletions

View File

@@ -2,20 +2,23 @@ package firewallconfigs
import "encoding/json"
const DefaultMaxRequestBodySize int64 = 1 << 20
// HTTPFirewallPolicy 防火墙策略
type HTTPFirewallPolicy struct {
Id int64 `yaml:"id" json:"id"`
IsOn bool `yaml:"isOn" json:"isOn"`
Name string `yaml:"name" json:"name"`
Description string `yaml:"description" json:"description"`
Inbound *HTTPFirewallInboundConfig `yaml:"inbound" json:"inbound"`
Outbound *HTTPFirewallOutboundConfig `yaml:"outbound" json:"outbound"`
BlockOptions *HTTPFirewallBlockAction `yaml:"blockOptions" json:"blockOptions"`
CaptchaOptions *HTTPFirewallCaptchaAction `yaml:"captchaOptions" json:"captchaOptions"`
Mode FirewallMode `yaml:"mode" json:"mode"`
UseLocalFirewall bool `yaml:"useLocalFirewall" json:"useLocalFirewall"`
SYNFlood *SYNFloodConfig `yaml:"synFlood" json:"synFlood"`
Log *HTTPFirewallPolicyLogConfig `yaml:"log" json:"log"` // 强制记录日志
Id int64 `yaml:"id" json:"id"`
IsOn bool `yaml:"isOn" json:"isOn"`
Name string `yaml:"name" json:"name"`
Description string `yaml:"description" json:"description"`
Inbound *HTTPFirewallInboundConfig `yaml:"inbound" json:"inbound"`
Outbound *HTTPFirewallOutboundConfig `yaml:"outbound" json:"outbound"`
BlockOptions *HTTPFirewallBlockAction `yaml:"blockOptions" json:"blockOptions"`
CaptchaOptions *HTTPFirewallCaptchaAction `yaml:"captchaOptions" json:"captchaOptions"`
Mode FirewallMode `yaml:"mode" json:"mode"`
UseLocalFirewall bool `yaml:"useLocalFirewall" json:"useLocalFirewall"`
SYNFlood *SYNFloodConfig `yaml:"synFlood" json:"synFlood"`
Log *HTTPFirewallPolicyLogConfig `yaml:"log" json:"log"` // 强制记录日志
MaxRequestBodySize int64 `yaml:"maxRequestBodySize" json:"maxRequestBodySize"` // 读取的请求最大尺寸
}
// Init 初始化