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
422b02b1
Commit
422b02b1
authored
1 year ago
by
Pavel Kácha
Browse files
Options
Downloads
Patches
Plain Diff
LaBrea: mitigate too big events again
parent
0fbd2b24
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
+2
-2
2 additions, 2 deletions
hp-labrea/labrea-idea.py
with
2 additions
and
2 deletions
hp-labrea/labrea-idea.py
+
2
−
2
View file @
422b02b1
...
@@ -35,7 +35,7 @@ class WindowContextMgr(object):
...
@@ -35,7 +35,7 @@ class WindowContextMgr(object):
self
.
first_update_queue
=
OrderedDict
()
self
.
first_update_queue
=
OrderedDict
()
self
.
last_update_queue
=
OrderedDict
()
self
.
last_update_queue
=
OrderedDict
()
# Hammer to mitigate too big events
# Hammer to mitigate too big events
self
.
max_count
=
200
0
self
.
max_count
=
200
self
.
max_src_ports
=
1024
self
.
max_src_ports
=
1024
def
expire_queue
(
self
,
queue
,
window
):
def
expire_queue
(
self
,
queue
,
window
):
...
@@ -154,7 +154,7 @@ class ConnectContextMgr(WindowContextMgr):
...
@@ -154,7 +154,7 @@ class ConnectContextMgr(WindowContextMgr):
ctx
[
"
src_ports
"
].
add
(
event
.
src_port
)
ctx
[
"
src_ports
"
].
add
(
event
.
src_port
)
ctx
[
"
count
"
]
+=
1
ctx
[
"
count
"
]
+=
1
ctx
[
"
last_update
"
]
=
self
.
update_timestamp
ctx
[
"
last_update
"
]
=
self
.
update_timestamp
return
ctx
[
"
count
"
]
<
self
.
max_count
return
len
(
ctx
[
"
tgt_ips_ports
"
]
)
<
self
.
max_count
def
ctx_close
(
self
,
ctx
):
def
ctx_close
(
self
,
ctx
):
src_ports
=
ctx
[
"
src_ports
"
]
if
len
(
ctx
[
"
src_ports
"
])
<=
self
.
max_src_ports
else
None
src_ports
=
ctx
[
"
src_ports
"
]
if
len
(
ctx
[
"
src_ports
"
])
<=
self
.
max_src_ports
else
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