Filter out "null" string in installed_path from osquery (#11931)

This commit is contained in:
Lucas Manuel Rodriguez 2023-05-24 14:28:20 -03:00 committed by GitHub
parent e500a4f65d
commit 9f7383b9ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1172,7 +1172,10 @@ func directIngestSoftware(ctx context.Context, logger log.Logger, host *fleet.Ho
software = append(software, s)
installedPath := strings.TrimSpace(row["installed_path"])
if installedPath != "" {
if installedPath != "" &&
// NOTE: osquery is sometimes incorrectly returning the value "null" for some install paths.
// Thus, we explicitly ignore such value here.
strings.ToLower(installedPath) != "null" {
key := fmt.Sprintf("%s%s%s", installedPath, fleet.SoftwareFieldSeparator, s.ToUniqueStr())
sPaths[key] = struct{}{}
}