reorganize

Signed-off-by: Jess Frazelle <acidburn@google.com>
This commit is contained in:
Jess Frazelle 2017-03-04 20:17:47 -08:00
parent acc5f0ce59
commit ba1c370d40
No known key found for this signature in database
GPG key ID: 18F3685C0022BFF3

View file

@ -437,21 +437,26 @@ func createVulnStaticPage(r *registry.Registry, staticDir, clairURI, repo, tag s
}
}
}
iteratePriorities(func(sev string) {
fmt.Fprintf(file, "%s: %d\n", sev, len(store[sev]))
})
fmt.Fprintln(file, "")
// return an error if there are more than 10 bad vulns
lenBadVulns := len(store["High"]) + len(store["Critical"]) + len(store["Defcon1"])
if lenBadVulns > 10 {
fmt.Fprintln(file, "--------------- ALERT ---------------")
fmt.Fprintf(file, "%d bad vunerabilities found", lenBadVulns)
}
fmt.Fprintln(file, "")
iteratePriorities(func(sev string) {
for _, v := range store[sev] {
fmt.Fprintf(file, "%s: [%s] \n%s\n%s\n", v.Name, v.Severity, v.Description, v.Link)
fmt.Fprintln(file, "-----------------------------------------")
}
})
iteratePriorities(func(sev string) {
fmt.Fprintf(file, "%s: %d\n", sev, len(store[sev]))
})
// return an error if there are more than 10 bad vulns
lenBadVulns := len(store["High"]) + len(store["Critical"]) + len(store["Defcon1"])
if lenBadVulns > 10 {
fmt.Fprintf(file, "%d bad vunerabilities found", lenBadVulns)
}
return nil
}