Parcourir la source

make Event viabl

bui il y a 1 an
Parent
commit
bb59d9852a
1 fichiers modifiés avec 7 ajouts et 4 suppressions
  1. 7 4
      pkg/acquisition/modules/waap/utils.go

+ 7 - 4
pkg/acquisition/modules/waap/utils.go

@@ -88,11 +88,11 @@ func EventFromRequest(r waf.ParsedRequest) (types.Event, error) {
 	evt.Line = types.Line{
 		Time: time.Now(),
 		//should we add some info like listen addr/port/path ?
-		Labels:  map[string]string{"type": "coraza-waf"},
+		Labels:  map[string]string{"type": "coraza-waap"},
 		Process: true,
-		Module:  "waf",
-		Src:     "waf",
-		Raw:     "dummy-waf-data", //we discard empty Line.Raw items :)
+		Module:  "waap",
+		Src:     "waap",
+		Raw:     "dummy-waap-data", //we discard empty Line.Raw items :)
 	}
 	evt.Waap = types.WaapEvent{}
 
@@ -144,6 +144,9 @@ func (r *WaapRunner) AccumulateTxToEvent(evt *types.Event, req waf.ParsedRequest
 	if evt.Meta == nil {
 		evt.Meta = map[string]string{}
 	}
+	if evt.Parsed == nil {
+		evt.Parsed = map[string]string{}
+	}
 	if req.IsInBand {
 		evt.Meta["waap_interrupted"] = "true"
 		evt.Meta["waap_action"] = req.Tx.Interruption().Action