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:
Kota Kanbe
2018-11-30 15:41:59 +09:00
committed by GitHub
parent 9d7b115bb5
commit 6e82981ee3
4 changed files with 47 additions and 25 deletions

View File

@@ -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