feat(report): Display CERT information to reports (#741)
* fix(tui): show JPCERT Alert URL in TUI * feat(tui): show `!` when the CVE-ID corresponds to USCERT or JPCERT alert * feat(report): display cert alert info to stdout report * fix(report): Display CVEs detected by CPEs with -ignore-unfixed flag
This commit is contained in:
@@ -20,11 +20,12 @@ package models
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/future-architect/vuls/alert"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/future-architect/vuls/alert"
|
||||
|
||||
"github.com/future-architect/vuls/config"
|
||||
exploitmodels "github.com/mozqnet/go-exploitdb/models"
|
||||
)
|
||||
@@ -694,6 +695,23 @@ type AlertDict struct {
|
||||
En []alert.Alert
|
||||
}
|
||||
|
||||
// HasAlert returns whether or not it has En or Ja entries.
|
||||
func (a AlertDict) HasAlert() bool {
|
||||
return len(a.En) != 0 || len(a.Ja) != 0
|
||||
}
|
||||
|
||||
// FormatSource returns which source has this alert
|
||||
func (a AlertDict) FormatSource() string {
|
||||
s := []string{}
|
||||
if len(a.En) != 0 {
|
||||
s = append(s, "USCERT")
|
||||
}
|
||||
if len(a.Ja) != 0 {
|
||||
s = append(s, "JPCERT")
|
||||
}
|
||||
return strings.Join(s, "/")
|
||||
}
|
||||
|
||||
// Confidences is a list of Confidence
|
||||
type Confidences []Confidence
|
||||
|
||||
|
||||
Reference in New Issue
Block a user