diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index 9ec4d645e6..8a29531cd7 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -571,8 +571,10 @@ def check_package_cves(nvd_path, packages): cpe_product_pkgs = defaultdict(list) for pkg in packages: if not pkg.has_valid_infra: + pkg.status['cve'] = ("na", "no valid package infra") continue if not pkg.current_version: + pkg.status['cve'] = ("na", "no version information available") continue if pkg.cpeid: cpe_product = cvecheck.cpe_product(pkg.cpeid) @@ -583,6 +585,13 @@ def check_package_cves(nvd_path, packages): for cve in cvecheck.CVE.read_nvd_dir(nvd_path): check_package_cve_affects(cve, cpe_product_pkgs) + for pkg in packages: + if 'cve' not in pkg.status: + if pkg.cves: + pkg.status['cve'] = ("error", "affected by CVEs") + else: + pkg.status['cve'] = ("ok", "not affected by CVEs") + def calculate_stats(packages): stats = defaultdict(int) stats['packages'] = len(packages) @@ -693,6 +702,18 @@ td.cpe-unknown { background: #ffd870; } +td.cve-ok { + background: #d2ffc4; +} + +td.cve-nok { + background: #ff9a69; +} + +td.cve-unknown { + background: #ffd870; +} +