Patch: Rename variable 'a' to 'formatted_alert'
Patch: Add json library
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import sys
|
import sys
|
||||||
import alert
|
import alert
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import iris_api
|
import iris_api
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@@ -25,16 +26,16 @@ def main():
|
|||||||
|
|
||||||
formatted_alert = processor.process(alert_json)
|
formatted_alert = processor.process(alert_json)
|
||||||
|
|
||||||
alert_result = client.alert(a.to_IRIS())
|
alert_result = client.alert(formatted_alert.to_IRIS())
|
||||||
|
|
||||||
match = None
|
match = None
|
||||||
|
|
||||||
for case in client.cases_list():
|
for case in client.cases_list():
|
||||||
if a.srcip in case["case_name"]:
|
if formatted_alert.srcip in case["case_name"]:
|
||||||
match = case
|
match = case
|
||||||
|
|
||||||
if match == None:
|
if match == None:
|
||||||
client.case_new(a.srcip, a.title)
|
client.case_new(formatted_alert.srcip, formatted_alert.title)
|
||||||
else:
|
else:
|
||||||
iocs = []
|
iocs = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user