Skip to content

Commit a169fb5

Browse files
committed
feat!(detector): replace go-kev with vuls2
Remove go-kev dependency and replace KEVuln detection with vuls2-based KEV enrichment pipeline. - Remove detector/kevuln.go and all FillWithKEVuln call sites - Remove KEVulnConf from config, TOML template, and subcmds - Add enrichKEV() in detector/vuls2/vendor.go that maps CISA KEV and VulnCheck KEV data from vuls2 DB to models.KEV - Add mapVulnCheckXDB() and mapVulnCheckReportedExploitation() helpers - Add unit tests for CISA KEV and VulnCheck KEV enrichment - Remove go-kev from dependabot.yml
1 parent afd0c4d commit a169fb5

File tree

25 files changed

+476
-510
lines changed

25 files changed

+476
-510
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ updates:
4444
- "github.com/vulsio/go-cti"
4545
- "github.com/vulsio/go-cve-dictionary"
4646
- "github.com/vulsio/go-exploitdb"
47-
- "github.com/vulsio/go-kev"
4847
- "github.com/vulsio/go-msfdb"
4948
- "github.com/vulsio/gost"
5049
trivy:
@@ -61,7 +60,6 @@ updates:
6160
- "github.com/vulsio/go-cti"
6261
- "github.com/vulsio/go-cve-dictionary"
6362
- "github.com/vulsio/go-exploitdb"
64-
- "github.com/vulsio/go-kev"
6563
- "github.com/vulsio/go-msfdb"
6664
- "github.com/vulsio/gost"
6765
- "github.com/aquasecurity/trivy"

config/config.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ type Config struct {
4242
Gost GostConf `json:"gost,omitzero"`
4343
Exploit ExploitConf `json:"exploit,omitzero"`
4444
Metasploit MetasploitConf `json:"metasploit,omitzero"`
45-
KEVuln KEVulnConf `json:"kevuln,omitzero"`
4645
Cti CtiConf `json:"cti,omitzero"`
4746
Vuls2 Vuls2Conf `json:"vuls2,omitzero"`
4847

@@ -192,7 +191,6 @@ func (c *Config) ValidateOnReport() bool {
192191
&Conf.Gost,
193192
&Conf.Exploit,
194193
&Conf.Metasploit,
195-
&Conf.KEVuln,
196194
&Conf.Cti,
197195
} {
198196
if err := cnf.Validate(); err != nil {

config/tomlloader.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ func (c TOMLLoader) Load(pathToToml string) error {
4242
&Conf.Gost,
4343
&Conf.Exploit,
4444
&Conf.Metasploit,
45-
&Conf.KEVuln,
4645
&Conf.Cti,
4746
} {
4847
cnf.Init()

config/vulnDictConf.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -254,33 +254,6 @@ func (cnf *MetasploitConf) Init() {
254254
cnf.DebugSQL = Conf.DebugSQL
255255
}
256256

257-
// KEVulnConf is go-kev config
258-
type KEVulnConf struct {
259-
VulnDict
260-
}
261-
262-
const kevulnDBType = "KEVULN_TYPE"
263-
const kevulnDBURL = "KEVULN_URL"
264-
const kevulnDBPATH = "KEVULN_SQLITE3_PATH"
265-
266-
// Init set options with the following priority.
267-
// 1. Environment variable
268-
// 2. config.toml
269-
func (cnf *KEVulnConf) Init() {
270-
cnf.Name = "kevuln"
271-
if os.Getenv(kevulnDBType) != "" {
272-
cnf.Type = os.Getenv(kevulnDBType)
273-
}
274-
if os.Getenv(kevulnDBURL) != "" {
275-
cnf.URL = os.Getenv(kevulnDBURL)
276-
}
277-
if os.Getenv(kevulnDBPATH) != "" {
278-
cnf.SQLite3Path = os.Getenv(kevulnDBPATH)
279-
}
280-
cnf.setDefault("go-kev.sqlite3")
281-
cnf.DebugSQL = Conf.DebugSQL
282-
}
283-
284257
// CtiConf is go-cti config
285258
type CtiConf struct {
286259
VulnDict

detector/detector.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,6 @@ func Detect(rs []models.ScanResult, dir string) ([]models.ScanResult, error) {
215215
}
216216
logging.Log.Infof("%s: %d exploits are detected", r.FormatServerName(), nMetasploitCve)
217217

218-
if err := FillWithKEVuln(&r, config.Conf.KEVuln, config.Conf.LogOpts); err != nil {
219-
return nil, xerrors.Errorf("Failed to fill with Known Exploited Vulnerabilities: %w", err)
220-
}
221-
222218
if err := FillWithCTI(&r, config.Conf.Cti, config.Conf.LogOpts); err != nil {
223219
return nil, xerrors.Errorf("Failed to fill with Cyber Threat Intelligences: %w", err)
224220
}

0 commit comments

Comments
 (0)