icpeo = db.getLastModified('cpeother') # check modification date date = False if icve is not None and icpeo is not None: # Go check date if icve >= icpeo: print("Not modified") sys.exit(0) else: date = True # only get collection of new CVE's collections = [] if date: collections = db.getCVEsNewerThan(icve) else: collections = db.getCVEs() # check cpes for cves and parse and store missing cpes in cpeother batch = [] # skip on empty collections col = list(collections) if not col: print("Empty collections, import skipped") sys.exit(2) for item in progressbar(col): for cpeentry in item['vulnerable_configuration']: checkdup = db.getAlternativeCPE(cpeentry) if checkdup and len(checkdup) <= 0:
icpeo = db.getLastModified('cpeother') # check modification date date = False if icve is not None and icpeo is not None: # Go check date if icve >= icpeo: print("Not modified") sys.exit(0) else: date = True # only get collection of new CVE's collections = [] if date: collections = db.getCVEsNewerThan(icve) else: collections = db.getCVEs() # check cpes for cves and parse and store missing cpes in cpeother batch = [] # skip on empty collections col=list(collections) if not col: print ("Empty collections, import skipped") sys.exit(2) for item in progressbar(col): for cpeentry in item['vulnerable_configuration']: checkdup = db.getAlternativeCPE(cpeentry) if checkdup and len(checkdup) <= 0:
icpeo = db.getLastModified('cpeother') # check modification date date = False if icve is not None and icpeo is not None: # Go check date if icve >= icpeo: print("Not modified") sys.exit(0) else: date = True # only get collection of new CVE's collections = [] if date: collections = db.getCVEsNewerThan(icve)['results'] else: collections = db.getCVEs()['results'] # check cpes for cves and parse and store missing cpes in cpeother batch = [] # skip on empty collections col=list(collections) if not col: print ("Empty collections, import skipped") sys.exit(2) for item in progressbar(col): for cpeentry in item['vulnerable_configuration']: checkdup = db.getAlternativeCPE(cpeentry) if checkdup and len(checkdup) <= 0:
icpeo = db.getLastModified('cpeother') # check modification date date = False if icve is not None and icpeo is not None: # Go check date if icve['last-modified'] >= icpeo['last-modified']: print("Not modified") sys.exit(0) else: date = True # only get collection of new CVE's collections = [] if date: db.getCVEsNewerThan(icve['last-modified']) else: db.getCVEs() # check cpes for cves and parse and store missing cpes in cpeother batch = [] # skip on empty collections col=list(collections) if not col: print ("Empty collections, import skipped") sys.exit(2) for item in progressbar(col): for cpeentry in item['vulnerable_configuration']: checkdup = db.getAlternativeCPE(cpeentry) if checkdup.count() <= 0: