make GetScope normalize the scope when we can

This commit is contained in:
bui 2023-01-17 14:47:53 +01:00
parent ecb5562b57
commit 86cf353456

View file

@ -1,5 +1,9 @@
package models package models
import (
"strings"
)
func (a *Alert) HasRemediation() bool { func (a *Alert) HasRemediation() bool {
return true return true
} }
@ -8,7 +12,15 @@ func (a *Alert) GetScope() string {
if a.Source.Scope == nil { if a.Source.Scope == nil {
return "" return ""
} }
return *a.Source.Scope //Normalize scope when we can
switch strings.ToLower(*a.Source.Scope) {
case "ip":
return "Ip"
case "range":
return "Range"
default:
return *a.Source.Scope
}
} }
func (a *Alert) GetValue() string { func (a *Alert) GetValue() string {