Add 2 download functions of suricata rules events

pull/2/merge
Debra Jules 2015-07-29 15:07:37 +02:00
parent 579a8368e6
commit f28c9cdf07
1 changed files with 18 additions and 0 deletions

View File

@ -196,6 +196,24 @@ class PyMISP(object):
session = self.__prepare_session('xml')
return session.get(xml)
def download_all_suricata(self):
"""
Download all suricata rules events.
"""
suricata_rules = self.url + '/nids/suricata/download'
session = self.__prepare_session('rules')
return session.get(suricata_rules)
def download_suricata_rule_event(self, event_id):
"""
Download one suricata rule event.
:param event_id: ID of the event to download (same as get)
"""
template = self.url + '/nids/suricata/download/{}'
session = self.__prepare_session('rules')
return session.get(template.format(event_id))
def download(self, event_id, with_attachement=False):
"""
Download one event in XML