Files
EdgeCommon/pkg/serverconfigs/firewallconfigs/http_firewall_action_block.go

27 lines
901 B
Go
Raw Normal View History

2020-10-06 21:02:21 +08:00
package firewallconfigs
2022-05-21 18:57:59 +08:00
import "net/http"
// HTTPFirewallBlockAction default block action
2020-10-06 21:02:21 +08:00
type HTTPFirewallBlockAction struct {
IsPrior bool `yaml:"isPrior" json:"isPrior"`
2021-10-19 10:28:18 +08:00
StatusCode int `yaml:"statusCode" json:"statusCode"`
Body string `yaml:"body" json:"body"` // supports HTML
URL string `yaml:"url" json:"url"`
Timeout int32 `yaml:"timeout" json:"timeout"` // 最小封禁时长
TimeoutMax int32 `yaml:"timeoutMax" json:"timeoutMax"` // 最大封禁时长
2021-10-19 10:28:18 +08:00
Scope FirewallScope `yaml:"scope" json:"scope"`
2024-04-07 14:21:29 +08:00
FailBlockScopeAll bool `yaml:"failBlockScopeAll" json:"failBlockScopeAll"`
2020-10-06 21:02:21 +08:00
}
2022-05-21 18:57:59 +08:00
2024-04-07 14:21:29 +08:00
func NewHTTPFirewallBlockAction() *HTTPFirewallBlockAction {
2022-05-21 18:57:59 +08:00
return &HTTPFirewallBlockAction{
2024-04-07 14:21:29 +08:00
StatusCode: http.StatusForbidden,
Body: "Blocked By WAF",
Timeout: 300,
FailBlockScopeAll: true,
2022-05-21 18:57:59 +08:00
}
}