This commit is contained in:
Alex Yang
2026-04-01 12:22:55 +08:00
parent 61789061ce
commit efebce3c39
46 changed files with 4797716 additions and 462145 deletions
+29
View File
@@ -0,0 +1,29 @@
package threat
import (
"time"
)
// ThreatAlert 威胁告警结构
type ThreatAlert struct {
ID string `json:"id"`
Timestamp time.Time `json:"timestamp"`
Level string `json:"level"` // low, medium, high
Type string `json:"type"` // 告警类型
Description string `json:"description"`
Details string `json:"details"`
SourceIP string `json:"sourceIP"`
Domain string `json:"domain"`
QueryType string `json:"queryType"`
Resolved bool `json:"resolved"` // 是否已解决
ResolvedTime time.Time `json:"resolvedTime,omitempty"`
Action string `json:"action,omitempty"` // 处理动作:blocked, allowed
}
// ClientQueryStats 客户端查询统计
type ClientQueryStats struct {
QueryCount int // 查询计数
NXDomainCount int // NXDOMAIN响应计数
LastQueryTime time.Time // 最后查询时间
QueryTypes map[string]int // 查询类型统计
}