Skip to content

Commit

Permalink
Updating nist.py for NIST API 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Minnix authored and Brandon Minnix committed Feb 25, 2024
1 parent f5323db commit 5bb2bb6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions netutils/nist.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_nist_urls_juniper_junos( # pylint: disable=R0911
List of NIST CPE URLs that may contain platform data.
"""
nist_urls = []
base_url = f"""https://services.nvd.nist.gov/rest/json/cpes/1.0?apiKey={api_key}&addOns=cves&cpeMatchString=cpe:2.3:o:juniper:junos"""
base_url = f"""https://services.nvd.nist.gov/rest/json/cpes/2.0?cpeMatchString=cpe:2.3:o:juniper:junos"""

# BASE
_main = os_platform_data.get("main")
Expand Down Expand Up @@ -102,7 +102,7 @@ def get_nist_urls_juniper_junos( # pylint: disable=R0911
raise ValueError("Failure creating Juniper JunOS Version. Format is unknown.")


def get_nist_urls_default(os_platform_data: t.Dict[str, t.Any], api_key: str) -> t.List[str]:
def get_nist_urls_default(os_platform_data: t.Dict[str, t.Any]) -> t.List[str]:
r"""Create a list of possible NIST Url strings.
Child models with NIST URL customizations need their own "get_nist_urls" method.
Expand All @@ -116,7 +116,7 @@ def get_nist_urls_default(os_platform_data: t.Dict[str, t.Any], api_key: str) ->
nist_urls = []
escape_list = [r"\(", r"\)"]
base_url = (
f"""https://services.nvd.nist.gov/rest/json/cpes/1.0?apiKey={api_key}&addOns=cves&cpeMatchString=cpe:2.3:o:"""
f"""https://services.nvd.nist.gov/rest/json/cpes/2.0?cpeMatchString=cpe:2.3:o:"""
)
os_platform_data = {"base_url": base_url, **os_platform_data}
delim_seven = ":*" * 7
Expand Down

0 comments on commit 5bb2bb6

Please sign in to comment.