@@ -12,6 +12,7 @@ with open(jsonfile) as f:
cvedata = json.load(f)
cves = dict()
+recipe_counts = {}
for recipe in cvedata['package']:
if recipe['name'] in ignored_recipes:
@@ -28,3 +29,16 @@ for recipe in cvedata['package']:
print("Found %d unpatched CVEs" % len(cves))
for cve in sorted(cves.keys()):
print("%s: %s https://web.nvd.nist.gov/view/vuln/detail?vulnId=%s *" % (cve, cves[cve], cve))
+
+for cve in cves:
+ recipename = cves[cve]
+ if recipename in recipe_counts:
+ recipe_counts[recipename] += 1
+ else:
+ recipe_counts[recipename] = 1
+
+
+print("\n")
+print("Summary of CVE counts by recipes:\n")
+for recipe, count in sorted(recipe_counts.items(), key=lambda x: x[1], reverse=True):
+ print(" %s: %s" % (recipe, count))
It is often helpful to know how many CVEs are open against a given recipe. Add a summary table of this to the end of the CVE listing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- scripts/cve-report.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+)