ntfy change
This commit is contained in:
parent
9a1f982ea6
commit
c6f365ff54
@ -24,26 +24,31 @@ click = "https://documentation.wazuh.com/"
|
||||
[[priority_map]]
|
||||
threat_map = [15, 14, 13, 12]
|
||||
mention_threshold = 1
|
||||
notify_threshold = 1
|
||||
color = 0xec3e40 # Red, SEVERE
|
||||
|
||||
[[priority_map]]
|
||||
threat_map = [11, 10, 9]
|
||||
mention_threshold = 1
|
||||
notify_threshold = 1
|
||||
color = 0xff9b2b # Orange, HIGH
|
||||
|
||||
[[priority_map]]
|
||||
threat_map = [8, 7, 6]
|
||||
mention_threshold = 5
|
||||
notify_threshold = 5
|
||||
color = 0xf5d800 # Yellow, ELEVATED
|
||||
|
||||
[[priority_map]]
|
||||
threat_map = [5, 4]
|
||||
mention_threshold = 20
|
||||
notify_threshold = 5
|
||||
color = 0x377fc7 # Blue, GUARDED
|
||||
|
||||
[[priority_map]]
|
||||
threat_map = [3, 2, 1, 0]
|
||||
mention_threshold = 20
|
||||
notify_threshold = 5
|
||||
color = 0x01a465 # Green, LOW
|
||||
|
||||
################ End of priority mapping ##################################
|
||||
|
||||
@ -29,15 +29,15 @@ func SendNtfy(params types.Params) {
|
||||
"```"
|
||||
} else {
|
||||
payload = time.Now().Format(time.RFC3339) + "\n\n" +
|
||||
"Agent: " + params.WazuhMessage.Parameters.Alert.Agent.Name + "\n" +
|
||||
"Event id: " + params.WazuhMessage.Parameters.Alert.Rule.ID + "\n" +
|
||||
"Description: " + params.WazuhMessage.Parameters.Alert.Rule.Description + "\n" +
|
||||
"Threat level: " + strconv.Itoa(params.WazuhMessage.Parameters.Alert.Rule.Level) + "\n" +
|
||||
"Times fired: " + strconv.Itoa(params.WazuhMessage.Parameters.Alert.Rule.Firedtimes) + "\n"
|
||||
"**Agent:** " + params.WazuhMessage.Parameters.Alert.Agent.Name + "\n" +
|
||||
"**Event id:** " + params.WazuhMessage.Parameters.Alert.Rule.ID + "\n" +
|
||||
"**Description:** " + params.WazuhMessage.Parameters.Alert.Rule.Description + "\n" +
|
||||
"**Threat level:** " + strconv.Itoa(params.WazuhMessage.Parameters.Alert.Rule.Level) + "\n" +
|
||||
"**Times fired:** " + strconv.Itoa(params.WazuhMessage.Parameters.Alert.Rule.Firedtimes) + "\n"
|
||||
}
|
||||
|
||||
req, _ := http.NewRequest("POST", os.Getenv("NTFY_URL"), strings.NewReader(payload))
|
||||
req.Header.Set("Content-Type", "text/plain")
|
||||
req.Header.Set("Content-Type", "text/markdown")
|
||||
|
||||
if params.General.Sender != "" {
|
||||
req.Header.Add("Title", params.General.Sender)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user