Skip to content

Commit

Permalink
Fixes for kafka integration (#522)
Browse files Browse the repository at this point in the history
* fix(kafka): set correct variables

* fix(kafka): made username and password optional.

The documentation states these as optional but in code these were mandatory.
  • Loading branch information
ChibangLW authored May 22, 2024
1 parent 20f4511 commit 42be533
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions parsedmarc/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,35 +845,27 @@ def process_reports(reports_):
exit(-1)
if "user" in kafka_config:
opts.kafka_username = kafka_config["user"]
else:
logger.critical("user setting missing from the "
"kafka config section")
exit(-1)
if "password" in kafka_config:
opts.kafka_password = kafka_config["password"]
else:
logger.critical("password setting missing from the "
"kafka config section")
exit(-1)
if "ssl" in kafka_config:
opts.kafka_ssl = kafka_config.getboolean("ssl")
if "skip_certificate_verification" in kafka_config:
kafka_verify = kafka_config.getboolean(
"skip_certificate_verification")
opts.kafka_skip_certificate_verification = kafka_verify
if "aggregate_topic" in kafka_config:
opts.kafka_aggregate = kafka_config["aggregate_topic"]
opts.kafka_aggregate_topic = kafka_config["aggregate_topic"]
else:
logger.critical("aggregate_topic setting missing from the "
"kafka config section")
exit(-1)
if "forensic_topic" in kafka_config:
opts.kafka_username = kafka_config["forensic_topic"]
opts.kafka_forensic_topic = kafka_config["forensic_topic"]
else:
logger.critical("forensic_topic setting missing from the "
"kafka config section")
if "smtp_tls_topic" in kafka_config:
opts.kafka_username = kafka_config["smtp_tls_topic"]
opts.kafka_smtp_tls_topic = kafka_config["smtp_tls_topic"]
else:
logger.critical("forensic_topic setting missing from the "
"splunk_hec config section")
Expand Down

0 comments on commit 42be533

Please sign in to comment.