Skip to content
Snippets Groups Projects
Commit 9a023aa7 authored by sw's avatar sw
Browse files

returned CVE URL to NIST page

parent f9e962c6
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ class CveProjectProvider(VulnDescriptionProvider): ...@@ -10,6 +10,7 @@ class CveProjectProvider(VulnDescriptionProvider):
Provides vulnerability descriptions using requests to CVEProject Provides vulnerability descriptions using requests to CVEProject
""" """
uri_template = 'https://raw.githubusercontent.com/CVEProject/cvelist/master/{}/{}/{}.json' uri_template = 'https://raw.githubusercontent.com/CVEProject/cvelist/master/{}/{}/{}.json'
nist_uri_template = 'https://nvd.nist.gov/vuln/detail/{}'
def __init__(self, session: Session): def __init__(self, session: Session):
self.sess = session self.sess = session
...@@ -29,7 +30,7 @@ class CveProjectProvider(VulnDescriptionProvider): ...@@ -29,7 +30,7 @@ class CveProjectProvider(VulnDescriptionProvider):
cve_json = response.json() cve_json = response.json()
description = cve_json['description']['description_data'][0]['value'] description = cve_json['description']['description_data'][0]['value']
self.cache[vuln] = description self.cache[vuln] = description
return VulnDescription(description, url) return VulnDescription(description, self.nist_uri_template.format(vuln))
except HTTPError as he: except HTTPError as he:
return VulnDescription('', 'Description fetching error: ' + str(he)) return VulnDescription('', 'Description fetching error: ' + str(he))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment