2024-05-10 14:23:54 +02:00
|
|
|
package services
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"os"
|
|
|
|
|
"strings"
|
|
|
|
|
"wazuh-notify/log"
|
2024-05-27 15:10:26 +02:00
|
|
|
"wazuh-notify/types"
|
2024-05-10 14:23:54 +02:00
|
|
|
)
|
|
|
|
|
|
2024-05-27 15:10:26 +02:00
|
|
|
func Filter(params types.Params) {
|
|
|
|
|
for _, rule := range strings.Split(params.General.ExcludedRules, ",") {
|
|
|
|
|
if rule == params.WazuhMessage.Parameters.Alert.Rule.ID {
|
2024-05-10 14:23:54 +02:00
|
|
|
log.Log("rule excluded")
|
|
|
|
|
log.CloseLogFile()
|
|
|
|
|
os.Exit(0)
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-27 15:10:26 +02:00
|
|
|
for _, agent := range strings.Split(params.General.ExcludedAgents, ",") {
|
|
|
|
|
if agent == params.WazuhMessage.Parameters.Alert.Agent.ID {
|
2024-05-10 14:23:54 +02:00
|
|
|
log.Log("agent excluded")
|
|
|
|
|
log.CloseLogFile()
|
|
|
|
|
os.Exit(0)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|