Skip to content

Commit

Permalink
config.yaml: treat all List values as list instead of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
AlyaGomaa committed Dec 13, 2024
1 parent 5bbb0e2 commit c2cf2f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
4 changes: 2 additions & 2 deletions config/slips.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ exporting_alerts:
# available options [slack,stix] without quotes
# export_to : [stix]
# export_to : [slack]
export_to : "[]"
export_to : []

# We'll use this channel to send alerts
slack_channel_name : proj_slips_alerting_module
Expand Down Expand Up @@ -368,7 +368,7 @@ DisabledAlerts:
# MALICIOUS_DOWNLOADED_FILE, MALICIOUS_URL

# disabled_detections = [THREAT_INTELLIGENCE_BLACKLISTED_IP, CONNECTION_TO_PRIVATE_IP]
disabled_detections : "[]"
disabled_detections : []

#############################
Docker:
Expand Down
19 changes: 2 additions & 17 deletions slips_files/common/parsers/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,9 @@ def get_tw_width_as_float(self):
return twid_width

def disabled_detections(self) -> list:
disabled_detections = self.read_configuration(
return self.read_configuration(
"DisabledAlerts", "disabled_detections", []
)
if disabled_detections:
disabled_detections = (
disabled_detections.replace("[", "")
.replace("]", "")
.replace(",", "")
.split()
)
return disabled_detections

def get_tw_width(self) -> str:
twid_width = self.get_tw_width_as_float()
Expand Down Expand Up @@ -290,14 +282,7 @@ def debug(self):
return debug

def export_to(self):
return (
self.read_configuration("exporting_alerts", "export_to", "[]")
.replace("]", "")
.replace("[", "")
.replace(" ", "")
.lower()
.split(",")
)
return self.read_configuration("exporting_alerts", "export_to", [])

def export_strato_letters(self) -> bool:
return self.read_configuration(
Expand Down

0 comments on commit c2cf2f9

Please sign in to comment.