|
@@ -121,6 +121,12 @@ func (c *Controller) CreateAlert(gctx *gin.Context) {
|
|
|
for _, alert := range input {
|
|
|
if len(alert.Decisions) > 0 {
|
|
|
log.Debugf("alert %s already has decisions, don't apply profiles", *alert.Message)
|
|
|
+ for _, decision := range alert.Decisions {
|
|
|
+ if decision.EndIP != 0 && decision.StartIP != 0 && decision.EndIP < decision.StartIP {
|
|
|
+ gctx.JSON(http.StatusBadRequest, gin.H{"message": "'start_ip' must be lower than or equal to 'end_ip' in decisions"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
decisions, err := csprofiles.EvaluateProfiles(c.Profiles, alert)
|
|
|
if err != nil {
|