Skip to content

Commit 80a4e69

Browse files
committed
feat: add falcon filtering for cve and score
1 parent 1189896 commit 80a4e69

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ falcon:
3535
cloud_region: "eu-1"
3636
# skip vulnerabilities without available patches
3737
skip_no_mitigation: true
38+
# what severity classes you want to skip
39+
skip_severities: ["low"]
40+
# minimum CVE base score to report
41+
min_cve_base_score: 0
3842

3943
# vmware workspace one
4044
ws1:

config/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ type Config struct {
2626
CloudRegion string `yaml:"cloud_region" env:"FALCON_CLOUD_REGION"`
2727

2828
SkipNoMitigation bool `yaml:"skip_no_mitigation" env:"FALCON_SKIP_NO_MITIGATION"`
29+
SkipSeverities []string `yaml:"skip_severities" env:"FALCON_SKIP_SEVERITIES"`
30+
MinCVEBaseScore int `yaml:"min_cve_base_score" env:"FALCON_MIN_CVE_BASE_SCORE"`
2931
} `yaml:"falcon"`
3032

3133
WS1 struct {

pkg/falcon/extractor.go

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,31 @@ func GetMessages(config *config.Config, ctx context.Context) (results map[string
173173
continue
174174
}
175175

176+
if config.Falcon.MinCVEBaseScore > 0 {
177+
if int(*vuln.Cve.BaseScore) < config.Falcon.MinCVEBaseScore {
178+
logrus.WithField("cve_score", *vuln.Cve.BaseScore).Debug("skipping vulnerability")
179+
continue
180+
}
181+
}
182+
183+
if len(config.Falcon.SkipSeverities) > 0 {
184+
vulnSev := strings.ToLower(*vuln.Cve.Severity)
185+
skip := false
186+
187+
for _, sev := range config.Falcon.SkipSeverities {
188+
if strings.EqualFold(sev, vulnSev) {
189+
logrus.WithField("severity", *vuln.Cve.Severity).Debug("skipping vulnerability")
190+
skip = true
191+
break
192+
}
193+
}
194+
195+
if skip { continue }
196+
}
197+
198+
logrus.WithField("cve_score", *vuln.Cve.BaseScore).WithField("severity", *vuln.Cve.Severity).
199+
Debug("adding vulnerability")
200+
176201
deviceFinding := UserDeviceFinding{
177202
ProductName: *vuln.App.ProductNameVersion,
178203
CveID: *vuln.Cve.ID,
@@ -181,8 +206,6 @@ func GetMessages(config *config.Config, ctx context.Context) (results map[string
181206
TimestampFound: *vuln.CreatedTimestamp,
182207
}
183208

184-
logrus.Warnf("%+v", vuln.HostInfo.Tags)
185-
186209
if _, ok := devices[uniqueDeviceID]; !ok {
187210
devices[uniqueDeviceID] = UserDevice{
188211
MachineName: fmt.Sprintf(

pkg/overview/security/builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func BuildSecurityOverviewMessage(logger *logrus.Logger, config config.Config, f
2323
var allWS1 []ws1.WS1Result
2424
for _, w := range ws1Results { allWS1 = append(allWS1, w) }
2525

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

2828
variables := struct {
2929
Falcon []falcon.FalconResult

0 commit comments

Comments
 (0)