Skip to content

Commit 793147a

Browse files
authored
fix: switch to ipv4 mirror to test routing issue (#5175)
Signed-off-by: Terri Oda <[email protected]>
1 parent 13c5b53 commit 793147a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

cve_bin_tool/data_sources/nvd_source.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
import asyncio
77
import datetime
8-
9-
# import glob
8+
import glob
109
import gzip
1110
import hashlib
1211
import json
@@ -50,11 +49,11 @@ class NVD_Source(Data_Source):
5049
CACHEDIR = DISK_LOCATION_DEFAULT
5150
BACKUPCACHEDIR = DISK_LOCATION_BACKUP
5251
FEED_NVD = "https://nvd.nist.gov/vuln/data-feeds"
53-
FEED_MIRROR = "https://mirror.cveb.in/nvd/json/cve/1.1"
52+
FEED_MIRROR = "https://v4.mirror.cveb.in/nvd/json/cve/1.1"
5453
LOGGER = LOGGER.getChild("CVEDB")
5554
NVDCVE_FILENAME_TEMPLATE = NVD_FILENAME_TEMPLATE
5655
META_LINK_NVD = "https://nvd.nist.gov"
57-
META_LINK_MIRROR = "https://mirror.cveb.in/nvd/json/cve/1.1"
56+
META_LINK_MIRROR = "https://v4.mirror.cveb.in/nvd/json/cve/1.1"
5857
META_REGEX_NVD = re.compile(r"feeds\/json\/.*-[0-9]*\.[0-9]*-[0-9]*\.meta")
5958
META_REGEX_MIRROR = re.compile(r"nvdcve-[0-9]*\.[0-9]*-[0-9]*\.meta")
6059
RANGE_UNSET = ""
@@ -621,9 +620,9 @@ def nvd_years(self) -> list[int]:
621620
"""
622621
Return the years we have NVD data for.
623622
"""
624-
# return sorted(
625-
# int(filename.split(".")[-3].split("-")[-1])
626-
# for filename in glob.glob(str(Path(self.cachedir) / "nvdcve-1.1-*.json.gz"))
627-
# )
623+
return sorted(
624+
int(filename.split(".")[-3].split("-")[-1])
625+
for filename in glob.glob(str(Path(self.cachedir) / "nvdcve-1.1-*.json.gz"))
626+
)
628627
# FIXME: temporary workaround so we don't try to load bad year data
629-
return list(range(2020, 2025))
628+
# return list(range(2020, 2025))

0 commit comments

Comments
 (0)