if api_key:
headers['apiKey'] = api_key
+ bb.note("Requesting %s" % str(args))
+
data = urllib.parse.urlencode(args)
full_request = url + '?' + data
r.close()
except Exception as e:
- bb.debug(2, "CVE database: received error (%s), retrying (request: %s)" %(e, full_request))
+ bb.note("CVE database: received error (%s), retrying (request: %s)" % (e, full_request))
time.sleep(6)
pass
else:
today_date = datetime.datetime.now(tz=datetime.timezone.utc)
delta = today_date - database_date
if delta.days < 120:
- bb.debug(2, "CVE database: performing partial update")
+ bb.note("CVE database: performing partial update")
req_args['lastModStartDate'] = database_date.isoformat()
req_args['lastModEndDate'] = today_date.isoformat()
else:
with bb.progress.ProgressHandler(d) as ph, open(os.path.join(d.getVar("TMPDIR"), 'cve_check'), 'a') as cve_f:
- bb.debug(2, "Updating entries")
+ bb.note("Updating entries")
index = 0
url = d.getVar("NVDCVE_URL")
while True:
index = data["startIndex"]
total = data["totalResults"]
per_page = data["resultsPerPage"]
-
+ bb.note("Got %d entries" % per_page)
for cve in data["vulnerabilities"]:
update_db(conn, cve)
for node in config["nodes"]:
parse_node_and_insert(conn, node, cveId)
except KeyError:
- bb.debug(2, "CVE %s has no configurations" % cveId)
+ bb.note("CVE %s has no configurations" % cveId)
do_fetch[nostamp] = "1"