-
Notifications
You must be signed in to change notification settings - Fork 950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a minimal rogue client detection mechanism at the transport level #2850
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2850 +/- ##
==========================================
- Coverage 57.23% 55.25% -1.98%
==========================================
Files 352 352
Lines 75520 67433 -8087
Branches 15988 13820 -2168
==========================================
- Hits 43223 37262 -5961
+ Misses 27870 26085 -1785
+ Partials 4427 4086 -341 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
/// <param name="remoteEndpoint"></param> | ||
internal void MarkAsPotentialRogue(IPAddress remoteEndpoint) | ||
{ | ||
Utils.LogError("MarkClientAsPotentialRogue address: {0} ", remoteEndpoint.ToString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be LogDebug
// Even if TryRemove fails it will most probably succeed at the next execution | ||
if (m_rogueClients.TryRemove(clientIp, out _)) | ||
{ | ||
Utils.LogInfo("Rogue Client with IP {0} is not tracked any longer, hasn't had rogue actions for more than {1} ms", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LogDebug would be better as well here I think
@mrsuciu tests fail on some pipelines: |
@romanett This did not happen on my local runs, but somehow the test machines running the tests do not provide IP Addresses. |
Proposed changes
Clients that behave rogue by repeatedly sending invalid messages in a certain interval of time are now tracked and blocked from connecting for a predefined amount of time.
Time calculations are independent of system time.
Related Issues
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that apply. You can also fill these out after creating the PR.Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...