def get_list_of_all_included_files(self, fo): if isinstance(fo, Firmware): fo.list_of_all_included_files = get_list_of_all_values( self.file_objects, '$_id', match={f'virtual_file_path.{fo.uid}': {'$exists': 'true'}}) if fo.list_of_all_included_files is None: fo.list_of_all_included_files = list(self.get_set_of_all_included_files(fo)) fo.list_of_all_included_files.sort() return fo.list_of_all_included_files
def get_list_of_all_included_files(self, fo): if isinstance(fo, Firmware): fo.list_of_all_included_files = get_list_of_all_values( self.file_objects, "$_id", match={"virtual_file_path.{}".format(fo.get_uid()): {"$exists": "true"}}) if fo.list_of_all_included_files is None: fo.list_of_all_included_files = list(self.get_set_of_all_included_files(fo)) fo.list_of_all_included_files.sort() return fo.list_of_all_included_files
def _fetch_children_with_tags(self, uid: str) -> List[FileObject]: uids = set() for plugin in PLUGINS_WITH_TAG_PROPAGATION: uids.update( set( get_list_of_all_values( self.file_objects, '$_id', match={ f'virtual_file_path.{uid}': {'$exists': 'true'}, f'processed_analysis.{plugin}.tags': {'$exists': 'true'} } ) ) ) return self.get_objects_by_uid_list(uids, analysis_filter=PLUGINS_WITH_TAG_PROPAGATION)
def _fetch_children_with_tags(self, uid): plugins_with_tag_propagation = [ # FIXME This should be inferred in a sensible way. This is not possible yet. 'crypto_material', 'cve_lookup', 'known_vulnerabilities', 'qemu_exec', 'software_components', 'users_and_passwords' ] uids = set() for plugin in plugins_with_tag_propagation: uids.update( set( get_list_of_all_values( self.file_objects, '$_id', match={ f'virtual_file_path.{uid}': {'$exists': 'true'}, f'processed_analysis.{plugin}.tags': {'$exists': 'true'} } ) ) ) return self.get_objects_by_uid_list(uids, analysis_filter=plugins_with_tag_propagation)