Skip to content

Commit 0aca67d

Browse files
authored
Merge pull request #19 from hazcod/work/commandbot
Feature: allow to skip certain CVEs
2 parents edc76fe + 056a83c commit 0aca67d

File tree

6 files changed

+25
-3
lines changed

6 files changed

+25
-3
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: pull_request
44

55
jobs:
66
goreleaser:
7-
name: go
7+
name: build
88
runs-on: ubuntu-latest
99
steps:
1010
-

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: pull_request
44

55
jobs:
66
golangci:
7-
name: go
7+
name: lint
88
runs-on: ubuntu-latest
99
steps:
1010
-

.github/workflows/todo.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
jobs:
88
todo:
9+
name: todo
910
runs-on: ubuntu-latest
1011
steps:
1112
-

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ falcon:
4747
skip_severities: ["low"]
4848
# minimum CVE base score to report
4949
min_cve_base_score: 0
50+
# the CVEs you want to ignore
51+
skip_cves: ["CVE-2019-15315"]
5052

5153
# vmware workspace one
5254
ws1:

config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ type Config struct {
2929
SkipNoMitigation bool `yaml:"skip_no_mitigation" env:"FALCON_SKIP_NO_MITIGATION"`
3030
SkipSeverities []string `yaml:"skip_severities" env:"FALCON_SKIP_SEVERITIES"`
3131
MinCVEBaseScore int `yaml:"min_cve_base_score" env:"FALCON_MIN_CVE_BASE_SCORE"`
32+
SkipCVEs []string `yaml:"skip_cves" env:"FALCON_SKIP_CVES"`
3233
} `yaml:"falcon"`
3334

3435
WS1 struct {

pkg/falcon/extractor.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,29 @@ func GetMessages(config *config.Config, ctx context.Context) (results map[string
175175
for _, vuln := range getResult.GetPayload().Resources {
176176

177177
if len(vuln.Remediation.Ids) == 0 && config.Falcon.SkipNoMitigation {
178-
logrus.WithField("app", *vuln.App.ProductNameVersion).Debug("skipping vulnerability without remediation")
178+
logrus.WithField("app", *vuln.App.ProductNameVersion).
179+
Debug("skipping vulnerability without remediation")
179180

180181
continue
181182
}
182183

184+
if *vuln.Cve.ID != "" && len(config.Falcon.SkipCVEs) > 0 {
185+
vulnIgnore := false
186+
187+
for _, cve := range config.Falcon.SkipCVEs {
188+
if strings.EqualFold(cve, *vuln.Cve.ID) {
189+
vulnIgnore = true
190+
break
191+
}
192+
}
193+
194+
if vulnIgnore {
195+
logrus.WithField("cve", *vuln.Cve.ID).WithField("host", *vuln.HostInfo.Hostname).
196+
Warn("skipping CVE")
197+
continue
198+
}
199+
}
200+
183201
uniqueDeviceID, err := getUniqueDeviceID(*vuln.HostInfo)
184202
if err != nil {
185203
logrus.WithError(err).Error("could not calculate unique device id")

0 commit comments

Comments
 (0)