Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reports-collector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
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
ai3
tools
reports-collector
Commits
5a39cecd
Commit
5a39cecd
authored
3 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Add ASN field to DMARC events
parent
7785289f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dmarc.go
+3
-0
3 additions, 0 deletions
dmarc.go
ip.go
+5
-1
5 additions, 1 deletion
ip.go
with
8 additions
and
1 deletion
dmarc.go
+
3
−
0
View file @
5a39cecd
...
...
@@ -153,6 +153,9 @@ func (h *DMARCHandler) eventFromRecord(report *dmarcReport, rec *dmarcRecord) Ev
e
.
Set
(
"report_id"
,
report
.
Metadata
.
ReportID
)
e
.
Set
(
"report_organization"
,
report
.
Metadata
.
Organization
)
if
asn
,
ok
:=
lookupASN
(
rec
.
Row
.
SourceIP
);
ok
{
e
.
Set
(
"asn"
,
asn
)
}
e
.
Set
(
"policy_evaluated_disposition"
,
rec
.
Row
.
PolicyEvaluated
.
Disposition
)
e
.
Set
(
"policy_evaluated_dkim"
,
rec
.
Row
.
PolicyEvaluated
.
DKIM
)
e
.
Set
(
"policy_evaluated_spf"
,
rec
.
Row
.
PolicyEvaluated
.
SPF
)
...
...
This diff is collapsed.
Click to expand it.
ip.go
+
5
−
1
View file @
5a39cecd
...
...
@@ -34,7 +34,11 @@ func lookupASN(addr string) (string, bool) {
geodbInit
.
Do
(
initGeoIP
)
if
geodb
!=
nil
{
asn
,
err
:=
geodb
.
ASN
(
net
.
ParseIP
(
addr
))
ip
:=
net
.
ParseIP
(
addr
)
if
ip
==
nil
{
return
""
,
false
}
asn
,
err
:=
geodb
.
ASN
(
ip
)
if
err
==
nil
{
return
fmt
.
Sprintf
(
"AS%d"
,
asn
.
AutonomousSystemNumber
),
true
}
...
...
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