-
Notifications
You must be signed in to change notification settings - Fork 177
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
T1499:TA0040 Endpoint DoS Query + Detection #615
Conversation
I like the idea of this detection. Using just the mean over a rolling 30-minute may be too FP prone. |
@calkim-panther I have altered the code to do two things:
Then we account for the average of the rolling_ledger (as before) and also test for a new historical maximum. My hope is that this reduces false positives. The reason why I do not do relative date comparisons (this Wednesday vs. last Wednesday, for example) is that I don't want to assume there will be predictable trends based on days of the week. I wanted something without that kind of dependency. Thoughts? |
An issue with the historical max is that it is an all-time max. If there were a massive dos attack that recorded a high max, subsequent attacks with a lower max count would not be detected. Local maximums would be better but I would still be concerned that a rolling mean would be FP prone due to natural periods of high/low activity and legitimate bursts. We would need a ledger of weeks at minimum to have better accuracy and not rely on purely mean but a deviation. |
@calkim-panther Your point about subsequent alerts did occur to me on the historical max values, and so the maximum counts are committed to The new alert condition is:
As a simple example, let's say: So the count_ledger And:
Then: So 1000 is > 10x the
The next run, At that point, 1200/172 < 10, so no alert. But rolling_ledger will continue to roll, the average will change, and we will account for any new maximums. Of course no DoS detection can be absolutely reliable. But I do not think this detection will result in as many FPs as it might seem on the surface. I would love to test this using some real data, since I believe the threshold values and rolling_ledger size can be tweaked for better results by default. |
Let's merge this as disabled first and we'll enable it in our env and monitor performance. |
@calkim-panther I've disabled the detection. Should I also disable the scheduled query? |
Background
Changes
Testing