Пример #1
0
    def analyze(self):
        """
        This is the 'main' method that launches all of the other checks
        """
        self.check_firewall_applications()

if __name__ == "__main__":

    start = time()

    # the "exec_date" is used as the "date" field in the datastore
    exec_date = strftime("%a, %d %b %Y %H:%M:%S", gmtime())

    # the table definitions are stored in a library file. this is instantiating
    # the ORM object and initializing the tables
    ORM = TyORM(Config.get("database"))
    if isfile(Config.get("database")):
        chmod(Config.get("database"), 0600)
    for k, v in tables.iteritems():
        ORM.initialize_table(k, v)

    ###########################################################################
    # Gather data
    ###########################################################################
    try:
        a = AnalyzePlist()
        if a is not None:
            plist_pre_changed_files = a.pre_changed_files
            plist_post_changed_files = a.post_changed_files
            plist_pre_new_files = a.pre_new_files
            plist_post_new_files = a.post_new_files
Пример #2
0
                self.check_key(i)

            # Aggregate self.data
            self.post_new_files.append(self.data)


if __name__ == "__main__":

    start = time()

    # the "exec_date" is used as the "date" field in the datastore
    exec_date = strftime("%a, %d %b %Y %H:%M:%S", gmtime())

    # the table definitions are stored in a library file. this is instantiating
    # the ORM object and initializing the tables
    ORM = TyORM(Config.get("database"))
    if isfile(Config.get("database")):
        chmod(Config.get("database"), 0600)
    for k, v in tables.iteritems():
        ORM.initialize_table(k, v)

    ###########################################################################
    # Gather data
    ###########################################################################
    try:
        a = AnalyzePlist()
        if a is not None:
            plist_pre_changed_files = a.pre_changed_files
            plist_post_changed_files = a.post_changed_files
            plist_pre_new_files = a.pre_new_files
            plist_post_new_files = a.post_new_files