Example #1
0
                "plist",
                "name",
                plist_pre_new_files,
            )
            data_science.get_new_entries()
    except Exception, error:
        print error_running_file(__file__, "lad", error)

    try:
        a = AnalyzeKexts()
        if a is not None:
            a.analyze()
            kext_data = a.data

            data_science = DataScience(ORM, kext_data, "kexts")
            data_science.get_all()
    except Exception, error:
        print error_running_file(__file__, "analyze_kexts", error)

    try:
        a = AnalyzeFirewallKeys()
        if a is not None:
            a.analyze()
            firewall_keys_data = a.data

            data_science = DataScience(
                ORM,
                firewall_keys_data,
                "firewall_keys"
            )
            data_science.get_all()
    # 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 = AnalyzeFirewallKeys()
        if a is not None:
            a.analyze()
            firewall_keys_data = a.data

            data_science = DataScience(ORM, firewall_keys_data,
                                       "firewall_keys")
            data_science.get_all()
    except Exception, error:
        print error_running_file(__file__, "analyze_firewall_keys", error)

    end = time()

    # to see how long this module took to execute, launch the module with
    # "--log" as a command line argument
    if "--log" in argv[1:]:
        logging.basicConfig(format='%(message)s', level=logging.INFO)
    logging.info("Execution took %s seconds.", str(end - start))
Example #3
0
    # 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:
        u = AnalyzeUsers()
        if u is not None:
            u.analyze()
            users = u.data
            data_science = DataScience(ORM, users, "users")
            all_entries = data_science.get_all()
    except Exception, error:
        print error_running_file(__file__, "lad", error)

    end = time()

    # to see how long this module took to execute, launch the module with
    # "--log" as a command line argument
    if "--log" in argv[1:]:
        logging.basicConfig(format='%(message)s', level=logging.INFO)
    logging.info("Execution took %s seconds.", str(end - start))
Example #4
0
    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:
        u = AnalyzeUsers()
        if u is not None:
            u.analyze()
            users = u.data
            data_science = DataScience(ORM, users, "users")
            all_entries = data_science.get_all()
    except Exception, error:
        print error_running_file(__file__, "lad", error)

    end = time()

    # to see how long this module took to execute, launch the module with
    # "--log" as a command line argument
    if "--log" in argv[1:]:
        logging.basicConfig(format="%(message)s", level=logging.INFO)
    logging.info("Execution took %s seconds.", str(end - start))