Fix splunk HEC submission and --outgoing-ssl option

Changed --outgoing-SSL to --outgoing-ssl
This commit is contained in:
Sean Whalen
2018-09-26 12:32:39 -04:00
parent 83a76ec0cd
commit c102c2f21c
4 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ CLI help
Email the results using this password
--outgoing-port OUTGOING_PORT
Email the results using this port
--outgoing-SSL OUTGOING_SSL
--outgoing-ssl OUTGOING_SSL
Use SSL/TLS instead of STARTTLS (more secure, and
required by some providers, like Gmail)
-F OUTGOING_FROM, --outgoing-from OUTGOING_FROM
+1 -1
View File
@@ -106,7 +106,7 @@ CLI help
Email the results using this password
--outgoing-port OUTGOING_PORT
Email the results using this port
--outgoing-SSL OUTGOING_SSL
--outgoing-ssl OUTGOING_SSL
Use SSL/TLS instead of STARTTLS (more secure, and
required by some providers, like Gmail)
-F OUTGOING_FROM, --outgoing-from OUTGOING_FROM
+5 -3
View File
@@ -121,7 +121,7 @@ def _main():
help="Email the results using this password")
arg_parser.add_argument("--outgoing-port",
help="Email the results using this port")
arg_parser.add_argument("--outgoing-SSL",
arg_parser.add_argument("--outgoing-ssl",
help="Use SSL/TLS instead of STARTTLS (more "
"secure, and required by some providers, "
"like Gmail)")
@@ -227,7 +227,8 @@ def _main():
forensic_reports += reports["forensic_reports"]
except IMAPError as error:
logger.error("IMAP Error: {0}".format(error.__str__()))
error_str = error.__str__().replace("b'", "").lstrip("'")
logger.error("IMAP Error: {0}".format(error_str))
exit(1)
results = OrderedDict([("aggregate_reports", aggregate_reports),
@@ -263,7 +264,8 @@ def _main():
test=args.test, nameservers=args.nameservers,
dns_timeout=args.timeout)
except IMAPError as error:
logger.error("IMAP Error: {0}".format(error.__str__()))
error_str = error.__str__().replace("b'", "").lstrip("'")
logger.error("IMAP Error: {0}".format(error_str))
exit(1)
+2 -4
View File
@@ -96,9 +96,8 @@ class HECClient(object):
data["sourcetype"] = "dmarc:aggregate"
data["event"] = new_report.copy()
json_str += "{0}\n".format(json.dumps(data))
try:
response = self.session.post(self.url, json=json_str).json()
response = self.session.post(self.url, data=json_str).json()
except Exception as e:
raise SplunkError(e.__str__())
if response["code"] != 0:
@@ -125,9 +124,8 @@ class HECClient(object):
data["sourcetype"] = "dmarc:forensic"
data["event"] = report.copy()
json_str += "{0}\n".format(json.dumps(data))
try:
response = self.session.post(self.url, json=json_str).json()
response = self.session.post(self.url, data=json_str).json()
except Exception as e:
raise SplunkError(e.__str__())
if response["code"] != 0: