From b95fdf92188b0e37f5e516dc381fa3d3df23a50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 25 Sep 2018 10:32:32 -0400 Subject: [PATCH] new: Update warninglists --- pymisp/api.py | 7 ++++++- tests/testlive_comprehensive.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pymisp/api.py b/pymisp/api.py index 0315120..b099647 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -1224,7 +1224,7 @@ class PyMISP(object): 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 - + :param sample_hash: hash of sample :param event_id: ID of event :param all_samples: download all samples @@ -1697,6 +1697,11 @@ class PyMISP(object): response = self._prepare_request('GET', url) 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 ################## def get_galaxies(self): diff --git a/tests/testlive_comprehensive.py b/tests/testlive_comprehensive.py index 594ce39..ab5624f 100644 --- a/tests/testlive_comprehensive.py +++ b/tests/testlive_comprehensive.py @@ -580,8 +580,8 @@ class TestComprehensive(unittest.TestCase): # self.assertEqual(len(events), 1) # 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_id=[17], force_enable=True) # enable ipv4 DNS. self.assertDictEqual(response, {'saved': True, 'success': '3 warninglist(s) enabled'}) second.add_attribute('ip-src', '9.9.9.9') second = self.user_misp_connector.update_event(second)