浏览代码

SignalOccurence can't lead to BanApplication if there is no source in the Event (#96)

Thibault "bui" Koechlin 5 年之前
父节点
当前提交
652b54ee81
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      pkg/outputs/ouputs.go

+ 5 - 0
pkg/outputs/ouputs.go

@@ -45,6 +45,11 @@ func OvflwToOrder(sig types.SignalOccurence, prof types.Profile) (*types.BanOrde
 		/*if the profil has no remediation, no order */
 		/*if the profil has no remediation, no order */
 		return nil, nil, fmt.Errorf("no remediation")
 		return nil, nil, fmt.Errorf("no remediation")
 	}
 	}
+
+	if sig.Source == nil {
+		return nil, nil, fmt.Errorf("no 'source' in event (Meta.source_ip empty?)")
+	}
+
 	ordr.MeasureSource = "local"
 	ordr.MeasureSource = "local"
 	ordr.Reason = sig.Scenario
 	ordr.Reason = sig.Scenario
 	//Identify scope
 	//Identify scope