diff --git a/cmd/crowdsec-cli/idgen/machineid.go b/cmd/crowdsec-cli/idgen/machineid.go index 6cb57bd830a..434f79128e9 100644 --- a/cmd/crowdsec-cli/idgen/machineid.go +++ b/cmd/crowdsec-cli/idgen/machineid.go @@ -42,6 +42,7 @@ func GenerateMachineID(prefix string) (string, error) { } prefix = strings.ReplaceAll(prefix, "-", "")[:32] + suffix, err := GeneratePassword(16) if err != nil { return "", err diff --git a/cmd/crowdsec-cli/idgen/password.go b/cmd/crowdsec-cli/idgen/password.go index 059d4a0ca7b..9f1925288ce 100644 --- a/cmd/crowdsec-cli/idgen/password.go +++ b/cmd/crowdsec-cli/idgen/password.go @@ -1,8 +1,8 @@ package idgen import ( - "fmt" saferand "crypto/rand" + "fmt" "math/big" ) diff --git a/pkg/leakybucket/overflows.go b/pkg/leakybucket/overflows.go index 1a5dcfa1f76..62ba3bc9a81 100644 --- a/pkg/leakybucket/overflows.go +++ b/pkg/leakybucket/overflows.go @@ -149,6 +149,7 @@ func eventSources(evt types.Event, leaky *Leaky) (map[string]models.Source, erro leaky.logger.Tracef("Valid range from %s : %s", src.IP, src.Range) } } + if leaky.scopeType.Scope == types.Ip { src.Value = &src.IP } else if leaky.scopeType.Scope == types.Range {