Пример #1
0
    def update(self, **kwargs):
        self.logger.info("CWE database update started")

        # if collection is non-existent; assume it's not an update
        if self.feed_type.lower() not in getTableNames():
            self.is_update = False

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

        self.logger.info("Finished CWE database update")

        return self.last_modified
Пример #2
0
    def update(self):
        self.logger.info("CVE database update started")
        # if collection is non-existent; assume it's not an update
        if "cves" not in getTableNames():
            self.is_update = False

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

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

        return self.last_modified
Пример #3
0
        logger.info("==========================")
        logger.info(time.strftime("%a %d %B %Y %H:%M", time.gmtime()))
        logger.info("==========================")
    if not args.l:
        loop = False
    newelement = 0
    for source in sources:
        if (not Configuration.includesFeed(source["name"])
                and source["name"] != "redis-cache-cpe"):
            continue
        if args.f and source["name"] != "redis-cache-cpe":
            logger.info("Dropping collection: " + source["name"])
            dropcollection(collection=source["name"])
            logger.info(source["name"] + " dropped")
        if source["name"] == "cpeother":
            if "cpeother" not in getTableNames():
                continue
        if source["name"] != "redis-cache-cpe":
            logger.info("Starting " + source["name"])
            before = nbelement(collection=source["name"])
            if args.f and source["name"] == "cpe":

                cpd = CPEDownloads()
                cpd.populate()

            elif args.f and source["name"] == "cve":

                cvd = CVEDownloads()

                cvd.populate()