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

This commit is contained in:
Thibault "bui" Koechlin 2020-06-29 13:22:56 +02:00 committed by GitHub
parent a4923a362f
commit 652b54ee81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,6 +45,11 @@ func OvflwToOrder(sig types.SignalOccurence, prof types.Profile) (*types.BanOrde
/*if the profil has no remediation, no order */
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.Reason = sig.Scenario
//Identify scope