Esempio n. 1
0
    def populate(self):
        urls = []

        self.logger.info("CVE database population started")

        self.logger.info(
            "Starting CVE database population starting from year: {}".format(
                cveStartYear))

        self.is_update = False

        dropCollection("cves")

        DatabaseIndexer().create_indexes(collection="cves")

        for x in self.get_cve_year_range():
            getfile = file_prefix + str(x) + file_suffix

            urls.append(self.feed_url + getfile)

        self.process_downloads(urls, collection=self.feed_type.lower())

        self.logger.info("Finished CVE database population")

        return self.last_modified
Esempio n. 2
0
    def populate(self, **kwargs):
        self.logger.info("CPE Database population started")
        dropCollection(self.feed_type.lower())

        self.is_update = False

        self.process_downloads(
            [self.feed_url], collection=self.feed_type.lower(),
        )

        self.logger.info("Finished CPE database population")

        return self.last_modified
Esempio n. 3
0
def dropcollection(collection=None):
    if collection is None:
        return False
    if collection == "cve":
        collection = "cves"
    ret = dropCollection(collection)
    return ret
Esempio n. 4
0
    def populate(self, **kwargs):
        self.logger.info("CPE Database population started")

        self.queue.clear()

        dropCollection(self.feed_type.lower())

        DatabaseIndexer().create_indexes(collection="cpe")

        self.is_update = False

        self.process_downloads([self.feed_url],
                               collection=self.feed_type.lower())

        self.logger.info("Finished CPE database population")

        return self.last_modified