mirror of
https://github.com/genuinetools/reg.git
synced 2024-09-28 11:46:20 -04:00
reorganize
Signed-off-by: Jess Frazelle <acidburn@google.com>
This commit is contained in:
parent
acc5f0ce59
commit
ba1c370d40
1 changed files with 14 additions and 9 deletions
|
@ -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) {
|
iteratePriorities(func(sev string) {
|
||||||
for _, v := range store[sev] {
|
for _, v := range store[sev] {
|
||||||
fmt.Fprintf(file, "%s: [%s] \n%s\n%s\n", v.Name, v.Severity, v.Description, v.Link)
|
fmt.Fprintf(file, "%s: [%s] \n%s\n%s\n", v.Name, v.Severity, v.Description, v.Link)
|
||||||
fmt.Fprintln(file, "-----------------------------------------")
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue