Merge pull request #10 from Starow/master

Add 2 download functions of suricata rules events
pull/2/merge
Raphaël Vinot 2015-07-29 16:09:57 +02:00
commit e353faa1be
1 changed files with 18 additions and 0 deletions

View File

@ -196,6 +196,24 @@ class PyMISP(object):
session = self.__prepare_session('xml') session = self.__prepare_session('xml')
return session.get(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): def download(self, event_id, with_attachement=False):
""" """
Download one event in XML Download one event in XML