feat(detector): add known exploited vulnerabilities (#1331)

* feat(kevuln): add known exploited vulnerabilities

* chore: transfer repository owner

* feat: show CISA on top of CERT

* chore: rename var

* chore: rename var

* chore: fix review

* chore: fix message
This commit is contained in:
MaineK00n
2021-11-19 15:06:17 +09:00
committed by GitHub
parent ffdb78962f
commit 89d94ad85a
15 changed files with 379 additions and 68 deletions

View File

@@ -636,7 +636,7 @@ func summaryLines(r models.ScanResult) string {
cvssScore + " |",
fmt.Sprintf("%-6s |", av),
fmt.Sprintf("%3s |", exploits),
fmt.Sprintf("%6s |", vinfo.AlertDict.FormatSource()),
fmt.Sprintf("%9s |", vinfo.AlertDict.FormatSource()),
fmt.Sprintf("%7s |", vinfo.PatchStatus(r.Packages)),
strings.Join(pkgNames, ", "),
}
@@ -808,22 +808,32 @@ func setChangelogLayout(g *gocui.Gui) error {
}
}
if len(vinfo.AlertDict.En) > 0 {
if len(vinfo.AlertDict.CISA) > 0 {
lines = append(lines, "\n",
"USCERT Alert",
"=============",
"CISA Alert",
"===========",
)
for _, alert := range vinfo.AlertDict.En {
for _, alert := range vinfo.AlertDict.CISA {
lines = append(lines, fmt.Sprintf("* [%s](%s)", alert.Title, alert.URL))
}
}
if len(vinfo.AlertDict.Ja) > 0 {
if len(vinfo.AlertDict.USCERT) > 0 {
lines = append(lines, "\n",
"USCERT Alert",
"=============",
)
for _, alert := range vinfo.AlertDict.USCERT {
lines = append(lines, fmt.Sprintf("* [%s](%s)", alert.Title, alert.URL))
}
}
if len(vinfo.AlertDict.JPCERT) > 0 {
lines = append(lines, "\n",
"JPCERT Alert",
"=============",
)
for _, alert := range vinfo.AlertDict.Ja {
for _, alert := range vinfo.AlertDict.JPCERT {
if r.Lang == "ja" {
lines = append(lines, fmt.Sprintf("* [%s](%s)", alert.Title, alert.URL))
} else {