mirror of https://github.com/MISP/PyMISP
new: Update warninglists
parent
da0f6ef7d2
commit
b95fdf9218
|
@ -1224,7 +1224,7 @@ class PyMISP(object):
|
||||||
|
|
||||||
def download_samples(self, sample_hash=None, event_id=None, all_samples=False, unzip=True):
|
def download_samples(self, sample_hash=None, event_id=None, all_samples=False, unzip=True):
|
||||||
"""Download samples, by hash or event ID. If there are multiple samples in one event, use the all_samples switch
|
"""Download samples, by hash or event ID. If there are multiple samples in one event, use the all_samples switch
|
||||||
|
|
||||||
:param sample_hash: hash of sample
|
:param sample_hash: hash of sample
|
||||||
:param event_id: ID of event
|
:param event_id: ID of event
|
||||||
:param all_samples: download all samples
|
:param all_samples: download all samples
|
||||||
|
@ -1697,6 +1697,11 @@ class PyMISP(object):
|
||||||
response = self._prepare_request('GET', url)
|
response = self._prepare_request('GET', url)
|
||||||
return self._check_response(response)
|
return self._check_response(response)
|
||||||
|
|
||||||
|
def update_warninglists(self):
|
||||||
|
url = urljoin(self.root_url, '/warninglists/update')
|
||||||
|
response = self._prepare_request('POST', url)
|
||||||
|
return self._check_response(response)
|
||||||
|
|
||||||
# ############## Galaxies/Clusters ##################
|
# ############## Galaxies/Clusters ##################
|
||||||
|
|
||||||
def get_galaxies(self):
|
def get_galaxies(self):
|
||||||
|
|
|
@ -580,8 +580,8 @@ class TestComprehensive(unittest.TestCase):
|
||||||
# self.assertEqual(len(events), 1)
|
# self.assertEqual(len(events), 1)
|
||||||
|
|
||||||
# warninglist
|
# warninglist
|
||||||
|
self.admin_misp_connector.update_warninglists()
|
||||||
response = self.admin_misp_connector.toggle_warninglist(warninglist_name='%dns resolv%', force_enable=True) # enable ipv4 DNS.
|
response = self.admin_misp_connector.toggle_warninglist(warninglist_name='%dns resolv%', force_enable=True) # enable ipv4 DNS.
|
||||||
# response = self.admin_misp_connector.toggle_warninglist(warninglist_id=[17], force_enable=True) # enable ipv4 DNS.
|
|
||||||
self.assertDictEqual(response, {'saved': True, 'success': '3 warninglist(s) enabled'})
|
self.assertDictEqual(response, {'saved': True, 'success': '3 warninglist(s) enabled'})
|
||||||
second.add_attribute('ip-src', '9.9.9.9')
|
second.add_attribute('ip-src', '9.9.9.9')
|
||||||
second = self.user_misp_connector.update_event(second)
|
second = self.user_misp_connector.update_event(second)
|
||||||
|
|
Loading…
Reference in New Issue