DDoS防护增加单IP TCP新连接速率黑名单

This commit is contained in:
刘祥超
2022-08-26 11:31:50 +08:00
parent 184d6f97bf
commit 5ae65edd0a
3 changed files with 50 additions and 31 deletions

View File

@@ -3,13 +3,18 @@
package ddosconfigs
type TCPConfig struct {
IsPrior bool `json:"isPrior"`
IsOn bool `json:"isOn"`
MaxConnections int32 `json:"maxConnections"`
MaxConnectionsPerIP int32 `json:"maxConnectionsPerIP"`
NewConnectionsRate int32 `json:"newConnectionsRate"`
AllowIPList []*IPConfig `json:"allowIPList"`
Ports []*PortConfig `json:"ports"`
IsPrior bool `json:"isPrior"`
IsOn bool `json:"isOn"`
MaxConnections int32 `json:"maxConnections"`
MaxConnectionsPerIP int32 `json:"maxConnectionsPerIP"`
NewConnectionsRate int32 `json:"newConnectionsRate"`
// 自动加入黑名单连接速率
DenyNewConnectionsRate int32 `json:"denyNewConnectionsRate"`
DenyNewConnectionsRateTimeout int32 `json:"denyNewConnectionsRateTimeout"`
AllowIPList []*IPConfig `json:"allowIPList"`
Ports []*PortConfig `json:"ports"`
}
func (this *TCPConfig) Init() error {