diff --git a/nudge-auto-updater.py b/nudge-auto-updater.py index 4ece6f5..b944dd0 100755 --- a/nudge-auto-updater.py +++ b/nudge-auto-updater.py @@ -558,15 +558,12 @@ def check_cve_numbers(conditions, cves, name, days, conjunction, found=False): else: conj = False if "fraction_actively_exploited_CVEs" in conditions: - if len(cves) < 1: - conj = False + if len(cves) > 0 and (sum(cves.values()) / len(cves)) >= conditions["fraction_actively_exploited_CVEs"]: + s = f'Fraction of actively exploited CVEs ({(sum(cves.values()) / len(cves))}) is greater than or equal to threshold {conditions["fraction_actively_exploited_CVEs"]}.' + met_cve_conditions.append(s) + disj = True else: - if (sum(cves.values()) / len(cves)) >= conditions["fraction_actively_exploited_CVEs"]: - s = f'Fraction of actively exploited CVEs ({(sum(cves.values()) / len(cves))}) is greater than or equal to threshold {conditions["fraction_actively_exploited_CVEs"]}.' - met_cve_conditions.append(s) - disj = True - else: - conj = False + conj = False if conjunction: return conj, met_cve_conditions return disj, met_cve_conditions