diff --git a/wazuh-notify-go/notification/discord.go b/wazuh-notify-go/notification/discord.go index 1e20a85..f6b977a 100644 --- a/wazuh-notify-go/notification/discord.go +++ b/wazuh-notify-go/notification/discord.go @@ -50,27 +50,27 @@ func SendDiscord(params types.Params) { switch params.Priority { case 1: - color = 0x339900 + color = params.PriorityMaps[4].Color if params.WazuhMessage.Parameters.Alert.Rule.Firedtimes >= params.PriorityMaps[4].MentionThreshold { mention = "@here" } case 2: - color = 0x99cc33 + color = params.PriorityMaps[3].Color if params.WazuhMessage.Parameters.Alert.Rule.Firedtimes >= params.PriorityMaps[3].MentionThreshold { mention = "@here" } case 3: - color = 0xffcc00 + color = params.PriorityMaps[2].Color if params.WazuhMessage.Parameters.Alert.Rule.Firedtimes >= params.PriorityMaps[2].MentionThreshold { mention = "@here" } case 4: - color = 0xff9966 + color = params.PriorityMaps[1].Color if params.WazuhMessage.Parameters.Alert.Rule.Firedtimes >= params.PriorityMaps[1].MentionThreshold { mention = "@here" } case 5: - color = 0xcc3300 + color = params.PriorityMaps[0].Color if params.WazuhMessage.Parameters.Alert.Rule.Firedtimes >= params.PriorityMaps[0].MentionThreshold { mention = "@here" } diff --git a/wazuh-notify-go/types/types.go b/wazuh-notify-go/types/types.go index d4971be..c543cc4 100644 --- a/wazuh-notify-go/types/types.go +++ b/wazuh-notify-go/types/types.go @@ -17,6 +17,7 @@ type Params struct { type PriorityMap struct { ThreatMap []int `yaml:"threat_map"` MentionThreshold int `yaml:"mention_threshold"` + Color int `yaml:"color"` } type Message struct { diff --git a/wazuh-notify-go/wazuh-notify-config.yaml b/wazuh-notify-go/wazuh-notify-config.yaml index b79d5b1..e455811 100644 --- a/wazuh-notify-go/wazuh-notify-config.yaml +++ b/wazuh-notify-go/wazuh-notify-config.yaml @@ -19,18 +19,23 @@ priority_map: - threat_map: [15,14,13,12] mention_threshold: 1 + color: 0xcc3300 - threat_map: [11,10,9] mention_threshold: 1 + color: 0xff9966 - threat_map: [8,7,6] mention_threshold: 5 + color: 0xffcc00 - threat_map: [5,4] mention_threshold: 5 + color: 0x99cc33 - threat_map: [3,2,1,0] mention_threshold: 5 + color: 0x339900 sender: "Wazuh (IDS)"