Commit e5b356d0 authored by qiuqunfeng's avatar qiuqunfeng
Browse files

Initialize Config with Debug mode and add UUID to attack logs

- Set the global configuration variable Conf to enable Debug mode
- Include UUID in the attack log structure for better identification of WAF detections
parent a4c820e1
...@@ -4,7 +4,9 @@ const ( ...@@ -4,7 +4,9 @@ const (
WeibuUrl = "https://api.threatbook.cn/v3/ip/query?apikey=d625206f5fdb49eeb98b0c30f46f4310a444f76d392540e8a0bb160d8a7d02c4&resource=" WeibuUrl = "https://api.threatbook.cn/v3/ip/query?apikey=d625206f5fdb49eeb98b0c30f46f4310a444f76d392540e8a0bb160d8a7d02c4&resource="
) )
var Conf Config var Conf Config = Config{
Debug: true,
}
type Config struct { type Config struct {
Debug bool Debug bool
......
...@@ -851,6 +851,7 @@ func (s *wafService) ListAttackLogs(ctx context.Context, req *AttackLogFilter) ( ...@@ -851,6 +851,7 @@ func (s *wafService) ListAttackLogs(ctx context.Context, req *AttackLogFilter) (
attackLogs := make([]AttackLog, len(list)) attackLogs := make([]AttackLog, len(list))
for i, wafDetection := range list { for i, wafDetection := range list {
attackLogs[i] = AttackLog{ attackLogs[i] = AttackLog{
Uuid: wafDetection.ID,
AttackTime: wafDetection.AttackTime, AttackTime: wafDetection.AttackTime,
AttackIp: wafDetection.AttackIP, AttackIp: wafDetection.AttackIP,
AttackedApp: wafDetection.AttackedApp, AttackedApp: wafDetection.AttackedApp,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment