-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(fetch/jvn): logging when invalid CVE-ID is found (#242)
* feat(fetch/jvn): logging when invalid CVE-ID is found * chore(fetch/jvn): change log message * chore: fix lint error
- Loading branch information
Showing
3 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -414,9 +414,16 @@ func getCveIDs(item Item) []string { | |
for _, ref := range item.References { | ||
switch ref.Source { | ||
case "NVD", "CVE": | ||
id := strings.TrimSpace(ref.ID) | ||
if cveIDPattern.MatchString(id) { | ||
cveIDsMap[id] = true | ||
if cveIDPattern.MatchString(ref.ID) { | ||
cveIDsMap[ref.ID] = true | ||
} else { | ||
id := strings.TrimSpace(ref.ID) | ||
if cveIDPattern.MatchString(id) { | ||
log.Warnf("CVE-ID with extra space. Please email JVNDB ([email protected]) to fix the rdf file with the following information. RDF data(Identifier: %s, Reference Source: %s, ID: %s)", item.Identifier, ref.Source, ref.ID) | ||
cveIDsMap[id] = true | ||
} else { | ||
log.Warnf("Failed to get CVE-ID. Invalid CVE-ID. Please email JVNDB ([email protected]) to fix the rdf file with the following information. RDF data(Identifier: %s, Reference Source: %s, ID: %s)", item.Identifier, ref.Source, ref.ID) | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters