Skip to content
Snippets Groups Projects
Commit 6fa0d0f0 authored by Yu-Hsin Yang's avatar Yu-Hsin Yang
Browse files

Add abuseip info to alert.go

parent 38b9e175
No related branches found
No related tags found
No related merge requests found
...@@ -141,7 +141,7 @@ func formatSlackMessage(canary interface{}, remoteIP string) (string, []Attachme ...@@ -141,7 +141,7 @@ func formatSlackMessage(canary interface{}, remoteIP string) (string, []Attachme
var message strings.Builder var message strings.Builder
message.WriteString("**Canary Alert**") message.WriteString(fmt.Sprintf("**Canary Alert: %s**", v.FieldByName("Tag")))
var fields []Field var fields []Field
for i := 0; i < v.NumField(); i++ { for i := 0; i < v.NumField(); i++ {
...@@ -159,7 +159,10 @@ func formatSlackMessage(canary interface{}, remoteIP string) (string, []Attachme ...@@ -159,7 +159,10 @@ func formatSlackMessage(canary interface{}, remoteIP string) (string, []Attachme
} }
// Append the ipinfo URL // Append the ipinfo URL
fields = append(fields, Field{Title: "CheckRemoteIPInfo", Value: fmt.Sprintf("http://ipinfo.io/%s", remoteIP)}) fields = append(fields, Field{Title: "CheckRemoteIPInfo", Value: fmt.Sprintf("http://ipinfo.io/%s", remoteIP), Short: true})
// Append abuse URL
fields = append(fields, Field{Title: "CheckAbuseInfo", Value: fmt.Sprintf("https://www.abuseipdb.com/check/%s", remoteIP), Short: true})
attachments := []Attachment{ attachments := []Attachment{
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment