mirror of https://github.com/MISP/PyMISP
chg: Add missing return formats in restsearch, bump objects
parent
1e0016cafa
commit
629fd14310
|
@ -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 ###
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c381598c3d89c6f7f50a0781fb37e7785a3296b2
|
||||
Subproject commit ffc120106c4ba9ed3b2fd5ae18d41f730e61b3ab
|
Loading…
Reference in New Issue