Files
SafeLine/management/webserver/model/policyrule.go
T
Binbim b8788c239e
MCP Docker / build-and-push (push) Has been cancelled
feat: SafeLine CE 9.3.9 with pro features
- Remove telemetry: disabled all phone-home (installation notify, false positives, behavior tracking, upgrade tips)
- Version branding: removed 'ce-' prefix, product name changed to '长亭雷池 WAF'
- Detection engine enhancement: strict preset enables all 17 modules with aggressive configs
- Multi-user RBAC: admin/operator/viewer roles with password + TOTP 2FA
- Rate limiting: nginx limit_req per website (RPS, burst, action)
- JS Challenge: browser fingerprint verification page with cookie-based bypass
- Security fixes: removed InsecureSkipVerify, hardcoded credentials, NO_AUTH backdoor
2026-07-04 07:59:04 +08:00

31 lines
766 B
Go

package model
import "gorm.io/datatypes"
type PolicyRule struct {
Base
Action int `gorm:"action" json:"action"`
Comment string `gorm:"comment" json:"comment"`
Pattern datatypes.JSON `gorm:"pattern" json:"pattern"`
IsEnabled bool `gorm:"is_enabled;default=true" json:"is_enabled"`
}
type PolicyRulePattern struct {
K string `json:"k"`
Op string `json:"op"`
V string `json:"v"`
}
const (
KeySrcIP = "src_ip"
KeyURI = "uri"
KeyHost = "host"
OpEq = "eq" // 完全相等
OpMatch = "match" // 模糊匹配
OpCIDR = "cidr" // CIDR
OpHas = "has" // 关键字
OpPrefix = "prefix" // 前缀关键字
OpRe = "re" // 正则
)