Skip to content

Commit

Permalink
Merge pull request #43 from hazcod/fix/emptyoverview
Browse files Browse the repository at this point in the history
fix: don't show overview for devices without findings
  • Loading branch information
hazcod authored Jan 7, 2022
2 parents 4d9f406 + a279af8 commit aff3d96
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions pkg/overview/security/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,36 @@ func BuildSecurityOverviewMessage(logger *logrus.Logger, config config.Config, f
}

var allFalcon []falcon.FalconResult
for _, f := range falconResults { allFalcon = append(allFalcon, f) }
for _, f := range falconResults {
allFalcon = append(allFalcon, f)
}

var allWS1 []ws1.WS1Result
for _, w := range ws1Results { allWS1 = append(allWS1, w) }
for _, w := range ws1Results {
hasIssues := false
for _, device := range w.Devices {
if len(device.Findings) > 0 {
hasIssues = true
break
}
}

if hasIssues {
allWS1 = append(allWS1, w)
}
}

logrus.Debugf("findings: falcon: %d ws1: %d", len(allFalcon), len(allWS1))

variables := struct {
Falcon []falcon.FalconResult
WS1 []ws1.WS1Result
Date time.Time
WS1 []ws1.WS1Result
Date time.Time
Errors []error
}{
Date: time.Now(),
Date: time.Now(),
Falcon: allFalcon,
WS1: allWS1,
WS1: allWS1,
Errors: reportedErrors,
}

Expand Down

0 comments on commit aff3d96

Please sign in to comment.