def get_cve_list(istio_version: str): advisory_links = istio_advisory_parser.retrieve_istio_sec_advisories() applicable_adv = utils.filter_not_applicable_advisories( istio_version, advisory_links) cves = [] for adv in applicable_adv: cves.extend(istio_advisory_parser.retrieve_cve_from_advisory_page(adv)) return cves if __name__ == '__main__': if len(sys.argv) != 2: raise ValueError(f'Provide an istio version to check, eg, 1.4.6') istio_version = sys.argv[1] eol_versions = istio_advisory_parser.retrieve_istio_unsupported_versions() if not utils.is_supported_version(istio_version, eol_versions): print( f'WARN Version {istio_version} is no longer supported - consider updating to current version' ) cves = get_cve_list(istio_version) if len(cves) < 1: print(f'No CVEs found cve') else: print(f'Found cve: {", ".join(cves)}') for cve in cves: retrieve_cve_nvd(cve)
def test_supported_version5(self): self.assertTrue(utils.is_supported_version('1.2.3', self.eol_versions))
def test_unsupported_version2(self): self.assertFalse(utils.is_supported_version('1.1', self.eol_versions))
def test_supported_version3(self): self.assertTrue(utils.is_supported_version('2.0', self.eol_versions))