forked from MISP/PyMISP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsuricata.py
More file actions
executable file
·28 lines (19 loc) · 765 Bytes
/
Copy pathsuricata.py
File metadata and controls
executable file
·28 lines (19 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pymisp import PyMISP
from keys import misp_url, misp_key
import argparse
def init(url, key):
return PyMISP(url, key, True)
def fetch(m, all_events, event):
if all_events:
print(misp.download_all_suricata().text)
else:
print(misp.download_suricata_rule_event(event).text)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Download Suricata events.')
parser.add_argument("-a", "--all", action='store_true', help="Download all suricata rules available.")
parser.add_argument("-e", "--event", help="Download suricata rules from one event.")
args = parser.parse_args()
misp = init(misp_url, misp_key)
fetch(misp, args.all, args.event)