Commit 361d8399 authored by qiuqunfeng's avatar qiuqunfeng
Browse files

Refactor WAF detection event structure in LogConsumerService to improve...

Refactor WAF detection event structure in LogConsumerService to improve clarity and detail. The genWafDetectionEvent function now includes action and request details in a nested format, enhancing the context of the generated events.
parent 727dff0b
...@@ -217,9 +217,15 @@ func (s *LogConsumerService) genWafDetectionEvent(wafDetectionMessage model.WafD ...@@ -217,9 +217,15 @@ func (s *LogConsumerService) genWafDetectionEvent(wafDetectionMessage model.WafD
"rule_name": attackedLog.RuleName, "rule_name": attackedLog.RuleName,
"action": attackedLog.Action, "action": attackedLog.Action,
"waf_body": map[string]interface{}{ "waf_body": map[string]interface{}{
"type": "code", "type": "code",
"request": attackedLog.ReqPkg, "request": map[string]interface{}{
"response": attackedLog.RspPkg, "action": attackedLog.Action,
"req_pkg": attackedLog.ReqPkg,
},
"response": map[string]interface{}{
"content_type": attackedLog.RspContentType,
"res_pkg": attackedLog.RspPkg,
},
}, },
}, },
} }
......
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