Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Go Canary Collector
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ComputerSecurity
Go Canary Collector
Commits
6fa0d0f0
Commit
6fa0d0f0
authored
9 months ago
by
Yu-Hsin Yang
Browse files
Options
Downloads
Patches
Plain Diff
Add abuseip info to alert.go
parent
38b9e175
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
alert/alert.go
+5
-2
5 additions, 2 deletions
alert/alert.go
with
5 additions
and
2 deletions
alert/alert.go
+
5
−
2
View file @
6fa0d0f0
...
@@ -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
{
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment