Add vendor links to -format-shor-text

This commit is contained in:
Kota Kanbe
2017-05-25 18:17:20 +09:00
committed by kota kanbe
parent af66e44427
commit ad096196ee
2 changed files with 7 additions and 2 deletions

View File

@@ -41,8 +41,6 @@ func (w EMailWriter) Write(rs ...models.ScanResult) (err error) {
for _, r := range rs {
if conf.FormatOneEMail {
message += formatFullPlainText(r) + "\r\n\r\n"
// totalResult.KnownCves = append(totalResult.KnownCves, r.KnownCves...)
// totalResult.UnknownCves = append(totalResult.UnknownCves, r.UnknownCves...)
} else {
var subject string
if len(r.Errors) != 0 {

View File

@@ -116,6 +116,11 @@ func formatShortPlainText(r models.ScanResult) string {
links := vuln.CveContents.SourceLinks(
config.Conf.Lang, r.Family, vuln.CveID)
vlinks := []string{}
for name, url := range vuln.VendorLinks(r.Family) {
vlinks = append(vlinks, fmt.Sprintf("%s (%s)", url, name))
}
cvsses := ""
for _, cvss := range vuln.CveContents.Cvss2Scores() {
cvsses += fmt.Sprintf("%s (%s)\n", cvss.Value.Format(), cvss.Type)
@@ -133,10 +138,12 @@ func formatShortPlainText(r models.ScanResult) string {
%s
---
%s
%s
%sConfidence: %v`,
maxCvss,
summaries[0].Value,
links[0].Value,
strings.Join(vlinks, "\n"),
cvsses,
// packsVer,
vuln.Confidence,