Skip to content

Stop updating the thresholds if training mode is turned off - #34

Open
symstu-tempesta wants to merge 1 commit into
mainfrom
symstu/16-mess-of-training-mode
Open

Stop updating the thresholds if training mode is turned off#34
symstu-tempesta wants to merge 1 commit into
mainfrom
symstu/16-mess-of-training-mode

Conversation

@symstu-tempesta

Copy link
Copy Markdown
Contributor

While the training_mode is 'off' the thresholds still updates and could generate false positives because of the lack of the data
#16

While the training_mode is 'off' the thresholds still updates and could generate false positives because of the lack of the data
#16

@krizhanovsky krizhanovsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch fixes off mode, but not historic mode

Comment thread core/lifespan.py
@@ -213,10 +213,6 @@ async def _update_threshold_and_block_users(self):
Periodically run the detectors, identify risky users, and update

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the copyrights of all the changed files

Comment thread core/lifespan.py
detector.update_threshold(users_before)

if self.context.app_config.training_mode != 'off':
detector.update_threshold(users_before)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This switched off thresholds update only for TRAINING_MODE="off", but historical mode being trained for a period in the past, still updates the thresholds with moving window. This actually almost fully remove the difference between historical and real modes.

Also the documentation also still has issues:

WebShield can learn your normal traffic in historical or real modes or just use predefined thresholds in no training mode.

means that off uses predefined thresholds, but immediately under the configuration sample the doc says

In this mode standard deviation and mean are determined using sliding window with time offset and duration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants