- Migration 0039: exclusion_notes JSONB in waf_configs (rule_id → note) - Model/Service/Handler: exclusion_notes in Upsert + GET durchgereicht - Alerts-Tab: "Als Ausnahme"-Button öffnet Modal mit Notiz-Textarea; Notiz wird in exclusion_notes gespeichert - Config-Drawer: Ausnahmen als Liste (Rule-ID + Notiz + Entfernen-Button) statt rohem Textfeld; Ausnahmen nur noch via Alert-Tab hinzufügbar - i18n EN + DE Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
21 lines
1.2 KiB
Go
21 lines
1.2 KiB
Go
package models
|
||
|
||
import "time"
|
||
|
||
// WafConfig holds the per-domain WAF policy.
|
||
// Default on creation: enabled=false, mode=detection, paranoia_level=1.
|
||
type WafConfig struct {
|
||
ID int64 `gorm:"primaryKey" json:"id"`
|
||
DomainID int64 `gorm:"column:domain_id;uniqueIndex" json:"domain_id"`
|
||
Enabled bool `gorm:"column:enabled" json:"enabled"`
|
||
Mode string `gorm:"column:mode" json:"mode"` // "detection" | "blocking"
|
||
ParanoiaLevel int `gorm:"column:paranoia_level" json:"paranoia_level"` // 1–4
|
||
RuleExclusions []string `gorm:"column:rule_exclusions;type:text[]" json:"rule_exclusions"`
|
||
ExclusionNotes map[string]string `gorm:"column:exclusion_notes;type:jsonb" json:"exclusion_notes"` // rule_id → note
|
||
TrustedProxies []string `gorm:"column:trusted_proxies;type:text[]" json:"trusted_proxies"`
|
||
CustomRules string `gorm:"column:custom_rules" json:"custom_rules"`
|
||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||
}
|
||
|
||
func (WafConfig) TableName() string { return "waf_configs" }
|