Beispiel #1
0
    def set_vulndb_id(self, vulndb_id):
        if vulndb_id is None:
            self._vulndb_id = None
            return

        if not DBVuln.is_valid_id(vulndb_id):
            raise ValueError('Invalid vulnerability DB id: %s' % vulndb_id)

        self._vulndb_id = vulndb_id
Beispiel #2
0
    def set_vulndb_id(self, vulndb_id):
        if vulndb_id is None:
            self._vulndb_id = None
            return

        if not DBVuln.is_valid_id(vulndb_id):
            raise ValueError('Invalid vulnerability DB id: %s' % vulndb_id)

        self._vulndb_id = vulndb_id
Beispiel #3
0
    def test_vulns_dict_points_to_existing_vulndb_data_id(self):
        invalid = []
        for vuln_name, _id in VULNS.iteritems():
            if _id is None:
                continue

            if not DBVuln.is_valid_id(_id):
                invalid.append((vuln_name, _id))

        self.assertEqual(invalid, [])
Beispiel #4
0
    def test_vulns_dict_points_to_existing_vulndb_data_id(self):
        invalid = []
        for vuln_name, _id in VULNS.iteritems():
            if _id is None:
                continue

            if not DBVuln.is_valid_id(_id):
                invalid.append((vuln_name, _id))

        self.assertEqual(invalid, [])
Beispiel #5
0
    def set_vulndb_id(self, vulndb_id):
        if vulndb_id is None:
            self._vulndb_id = None
            return

        if not DBVuln.is_valid_id(vulndb_id):
            all_db_ids = DBVuln.get_all_db_ids()
            msg = ('Invalid vulnerability DB id %s. There are %s entries in'
                   ' the vulnerability database but none is the specified one.')
            args = (vulndb_id, len(all_db_ids))
            raise ValueError(msg % args)

        self._vulndb_id = vulndb_id
Beispiel #6
0
    def set_vulndb_id(self, vulndb_id):
        if vulndb_id is None:
            self._vulndb_id = None
            return

        if not DBVuln.is_valid_id(vulndb_id):
            all_db_ids = DBVuln.get_all_db_ids()
            msg = ('Invalid vulnerability DB id %s. There are %s entries in'
                   ' the vulnerability database but none is the specified one.')
            args = (vulndb_id, len(all_db_ids))
            raise ValueError(msg % args)

        self._vulndb_id = vulndb_id