Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Warden Connectors
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
713
Warden
Warden Connectors
Commits
a93fe0f2
Commit
a93fe0f2
authored
1 year ago
by
Pavel Kácha
Browse files
Options
Downloads
Patches
Plain Diff
LaBrea: add ignored log lines
parent
422b02b1
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
hp-labrea/labrea-idea.py
+13
-2
13 additions, 2 deletions
hp-labrea/labrea-idea.py
with
13 additions
and
2 deletions
hp-labrea/labrea-idea.py
+
13
−
2
View file @
a93fe0f2
...
...
@@ -466,13 +466,22 @@ RE_LIST = (
# 1493035442 Initial Connect - tarpitting: 89.163.242.15 56736 -> 195.113.254.182 9898
# 1493037991 Inbound SYN/ACK: 185.62.190.15 21001 -> 195.113.252.222 15584
(
re
.
compile
(
r
'
([0-9]+) (
[^:]*
:) ([^ ]+) ([0-9]+) -> ([^ ]+) ([0-9]+).*
'
),
re
.
compile
(
r
'
([0-9]+) (
Initial Connect - tarpitting:|Inbound SYN/ACK
:) ([^ ]+) ([0-9]+) -> ([^ ]+) ([0-9]+).*
'
),
namedtuple
(
"
connect_tuple
"
,
(
"
timestamp
"
,
"
message
"
,
"
src_ip
"
,
"
src_port
"
,
"
tgt_ip
"
,
"
tgt_port
"
))
),
# 1493035442 Responded to a Ping: 88.86.96.25 -> 195.113.253.87 *
(
re
.
compile
(
r
'
([0-9]+) (
[^:]*
:) ([^ ]+) -> ([^ ]+).*
'
),
re
.
compile
(
r
'
([0-9]+) (
Responded to a Ping
:) ([^ ]+) -> ([^ ]+).*
'
),
namedtuple
(
"
ping_tuple
"
,
(
"
timestamp
"
,
"
message
"
,
"
src_ip
"
,
"
tgt_ip
"
))
),
# 1645797338 Capturing local IP 195.113.252.187
# 1645797339 Persist Activity: 45.227.253.45 64088 -> 195.113.254.67 3136 *
# 1645797340 Additional Activity 195.113.253.198
# 1645857629 Linux Persist Activity: 61.177.172.89 12241 -> 195.113.253.252 22 *
# 1645857629 Persist Trapping: 103.66.50.44 62229 -> 195.113.252.5 445 *
(
re
.
compile
(
r
'
([0-9]+) (?:Capturing local|Persist Activity:|Additional Activity|Linux Persist Activity:|Persist Trapping:).*
'
),
None
)
)
...
...
@@ -481,6 +490,8 @@ def match_event(line):
for
labrea_re
,
event_tuple
in
RE_LIST
:
match
=
labrea_re
.
match
(
line
)
if
match
:
if
not
event_tuple
:
return
None
return
event_tuple
(
*
match
.
groups
())
logging
.
info
(
"
Unmatched line:
\"
%s
\"
"
%
line
.
replace
(
"
\n
"
,
r
"
\n
"
))
return
None
...
...
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