diff --git a/pymisp/aping.py b/pymisp/aping.py index f810525..abcdd75 100644 --- a/pymisp/aping.py +++ b/pymisp/aping.py @@ -1413,7 +1413,7 @@ class ExpandedPyMISP(PyMISP): ''' - return_formats = ['openioc', 'json', 'xml', 'suricata', 'snort', 'text', 'rpz', 'csv', 'cache', 'stix', 'stix2'] + return_formats = ['openioc', 'json', 'xml', 'suricata', 'snort', 'text', 'rpz', 'csv', 'cache', 'stix', 'stix2', 'yara', 'yara-json', 'attack', 'attack-sightings'] if controller not in ['events', 'attributes', 'objects', 'sightings']: raise ValueError('controller has to be in {}'.format(', '.join(['events', 'attributes', 'objects']))) @@ -1728,6 +1728,19 @@ class ExpandedPyMISP(PyMISP): to_return.append(ml) return to_return + def search_feeds(self, value: Optional[SearchParameterTypes]=None, pythonify: Optional[bool]=False): + '''Search in the feeds cached on the servers''' + response = self._prepare_request('POST', '/feeds/searchCaches', data={'value': value}) + normalized_response = self._check_response(response, expect_json=True) + if not (self.global_pythonify or pythonify) or 'errors' in normalized_response: + return normalized_response + to_return = [] + for feed in normalized_response: + f = MISPFeed() + f.from_dict(**feed) + to_return.append(f) + return to_return + # ## END Search methods ### # ## BEGIN Communities ### diff --git a/pymisp/data/misp-objects b/pymisp/data/misp-objects index c381598..ffc1201 160000 --- a/pymisp/data/misp-objects +++ b/pymisp/data/misp-objects @@ -1 +1 @@ -Subproject commit c381598c3d89c6f7f50a0781fb37e7785a3296b2 +Subproject commit ffc120106c4ba9ed3b2fd5ae18d41f730e61b3ab