def verify(cls): # load default configuration file config = ConfigParser() config.read(os.path.join(os.path.dirname(__file__), 'config.ini')) os_db = config.get('NSRL', 'nsrl_os_db') mfg_db = config.get('NSRL', 'nsrl_mfg_db') file_db = config.get('NSRL', 'nsrl_file_db') prod_db = config.get('NSRL', 'nsrl_prod_db') databases = [os_db, mfg_db, file_db, prod_db] # check for configured database path results = list(map(os.path.exists, databases)) dbs_available = reduce(lambda x, y: x or y, results, False) if not dbs_available: raise PluginLoadError("{0}: verify() failed because " "databases are not available." "".format(cls.__name__)) # check for LOCK file and remove it dbs_locks = [os.path.join(x, "LOCK") for x in databases] for lock in dbs_locks: try: if os.path.exists(lock): os.unlink(lock) except: raise PluginLoadError("unable to remove lock {0}".format(lock))
def verify(cls): # create an instance module = McAfeeVSCL() path = module.scan_path del module # perform checks if not path or not os.path.exists(path): raise PluginLoadError("{0}: verify() failed because " "McAfeeVSCL executable was not found." "".format(cls.__name__))
def verify(cls): # check if sophos is available module = SophosWin() path = module.scan_path del module # perform checks if not path or not os.path.exists(path): raise PluginLoadError("{0}: verify() failed because " "Sophos executable was not found." "".format(cls.__name__))
def verify(cls): # load default configuration file config = ConfigParser() config.read(os.path.join(os.path.dirname(__file__), 'config.ini')) sign_path = config.get('PEiD', 'sign_path') # check for configured signatures path if not os.path.exists(sign_path): raise PluginLoadError("{0}: verify() failed because " "signatures file not found." "".format(cls.__name__))
def verify(cls): module = Symantec() if not module.scan_path or not os.path.exists(module.scan_path): del module raise PluginLoadError("Unable to find Symantec executable") del module