-
Notifications
You must be signed in to change notification settings - Fork 30
Add simple peak detection #152
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
Conversation
| // Have we sent more than three alerts in the last hour | ||
| $lastHour = count($this->mapper->findRecentByUid($uid, $now - 60 * 60)); | ||
| if ($lastHour >= 3) { | ||
| $this->logger->warning("Suspicious login peak detected: $uid received $lastTwoDays alerts in the last hour"); |
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.
$lastTwoDays seems incorrect
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.
| $this->logger->warning("Suspicious login peak detected: $uid received $lastTwoDays alerts in the last hour"); | |
| $this->logger->warning("Suspicious login peak detected: $uid received $lastHour alerts in the last hour"); |
rullzer
left a comment
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.
Overall looks good but the counting of the notifications is not right I think :P
Signed-off-by: Christoph Wurst <[email protected]>
a0d7c25 to
8d3b253
Compare
|
Please have another look.
|
While #152 addressed rate limiting notifications to users, we still have some logging outside of there that isn't covered. * Adjusts log levels (Warning -> a mixture of Debug and Info) of the two main messages that aren't rate limited * Adjusts log levels of the already rate limited messages to Info level (from Warning) to be more consistent with Brute Force Protection log levels This cuts down on the log noise from "Detected a login from a suspicious login..." All logs remain available at the appropriate log levels if desired. Signed-off-by: Josh <[email protected]>
While #152 addressed rate limiting notifications to users, we still have some logging outside of there that isn't covered. * Adjusts log levels (Warning -> a mixture of Debug and Info) of the two main messages that aren't rate limited * Adjusts log levels of the already rate limited messages to Info level (from Warning) to be more consistent with Brute Force Protection log levels This cuts down on the log noise from "Detected a login from a suspicious login..." All logs remain available at the appropriate log levels if desired. Signed-off-by: Josh <[email protected]>
While #152 addressed rate limiting notifications to users, we still have some logging outside of there that isn't covered. * Adjusts log levels (Warning -> a mixture of Debug and Info) of the two main messages that aren't rate limited * Adjusts log levels of the already rate limited messages to Info level (from Warning) to be more consistent with Brute Force Protection log levels This cuts down on the log noise from "Detected a login from a suspicious login..." All logs remain available at the appropriate log levels if desired. Signed-off-by: Josh <[email protected]>
While #152 addressed rate limiting notifications to users, we still have some logging outside of there that isn't covered. * Adjusts log levels (Warning -> a mixture of Debug and Info) of the two main messages that aren't rate limited * Adjusts log levels of the already rate limited messages to Info level (from Warning) to be more consistent with Brute Force Protection log levels This cuts down on the log noise from "Detected a login from a suspicious login..." All logs remain available at the appropriate log levels if desired. Signed-off-by: Josh <[email protected]>
While #152 addressed rate limiting notifications to users, we still have some logging outside of there that isn't covered. * Adjusts log levels (Warning -> a mixture of Debug and Info) of the two main messages that aren't rate limited * Adjusts log levels of the already rate limited messages to Info level (from Warning) to be more consistent with Brute Force Protection log levels This cuts down on the log noise from "Detected a login from a suspicious login..." All logs remain available at the appropriate log levels if desired. Signed-off-by: Josh <[email protected]>
While #152 addressed rate limiting notifications to users, we still have some logging outside of there that isn't covered. * Adjusts log levels (Warning -> a mixture of Debug and Info) of the two main messages that aren't rate limited * Adjusts log levels of the already rate limited messages to Info level (from Warning) to be more consistent with Brute Force Protection log levels This cuts down on the log noise from "Detected a login from a suspicious login..." All logs remain available at the appropriate log levels if desired. Signed-off-by: Josh <[email protected]>
While #152 addressed rate limiting notifications to users, we still have some logging outside of there that isn't covered. * Adjusts log levels (Warning -> a mixture of Debug and Info) of the two main messages that aren't rate limited * Adjusts log levels of the already rate limited messages to Info level (from Warning) to be more consistent with Brute Force Protection log levels This cuts down on the log noise from "Detected a login from a suspicious login..." All logs remain available at the appropriate log levels if desired. Signed-off-by: Josh <[email protected]>
Fixes #115