Exemple #1
0
 def _fetch_by_id(self):
     if self.vuln_id:
         self._vulnerability = Vulnerability.get_by_id(self.vuln_id)
     elif self.vcdb_id:
         self._vulnerability = Vulnerability.get_by_vcdb_id(self.vcdb_id)
     elif self.cve_id:
         if not self.is_cve_id(self.cve_id):
             raise InvalidIdentifierException(
                 "Please provide a valid CVE ID.")
         self._vulnerability = Vulnerability.get_by_cve_id(self.cve_id)
Exemple #2
0
 def _fetch_by_id(self):
     if self.vuln_id:
         logging.debug("Loading vuln by vulnid %r", self.vuln_id)
         self._vulnerability = Vulnerability.get_by_id(self.vuln_id)
     elif self.vcdb_id:
         logging.debug("Loading vuln by vcdbid %r", self.vcdb_id)
         self._vulnerability = Vulnerability.get_by_vcdb_id(self.vcdb_id)
     elif self.cve_id:
         logging.debug("Loading vuln by cveid %r", self.cve_id)
         logging.warning(
             "No identifier available to load vulnerability entry")
         if not self.is_cve_id(self.cve_id):
             raise InvalidIdentifierException(
                 "Please provide a valid CVE ID.")
         self._vulnerability = Vulnerability.get_by_cve_id(self.cve_id)
     else:
         logging.warning(
             "No identifier available to load vulnerability entry")