34 lines
610 B
Go
Raw Normal View History

2024-05-08 01:56:48 +02:00
package main
import (
"strings"
2024-05-27 15:10:26 +02:00
"wazuh-notify/discord"
2024-05-09 15:27:45 +02:00
"wazuh-notify/log"
2024-05-27 14:51:22 +02:00
"wazuh-notify/ntfy"
2024-05-09 15:27:45 +02:00
"wazuh-notify/services"
2024-05-27 14:51:22 +02:00
"wazuh-notify/slack"
2024-05-08 01:56:48 +02:00
)
func main() {
2024-05-27 15:10:26 +02:00
configParams := services.ReadConfig()
2024-05-09 12:24:44 +02:00
2024-05-27 15:10:26 +02:00
inputParams := services.ParseFlags(configParams)
Params := services.ParseWazuhInput(inputParams)
for _, target := range strings.Split(Params.General.Targets, ", ") {
2024-05-08 01:56:48 +02:00
switch target {
case "discord":
2024-05-09 15:27:45 +02:00
log.Log(target)
2024-05-27 15:10:26 +02:00
discord.SendDiscord(Params)
2024-05-08 01:56:48 +02:00
case "ntfy":
2024-05-09 15:27:45 +02:00
log.Log(target)
2024-05-27 15:10:26 +02:00
ntfy.SendNtfy(Params)
2024-05-27 11:44:24 +02:00
case "slack":
log.Log(target)
2024-05-27 15:10:26 +02:00
slack.SendSlack(Params)
2024-05-08 01:56:48 +02:00
}
}
2024-05-27 11:44:24 +02:00
log.CloseLogFile()
2024-05-08 01:56:48 +02:00
}