Skip to content
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

skip user iter if already banned #31

Merged
merged 1 commit into from
Dec 7, 2023
Merged

skip user iter if already banned #31

merged 1 commit into from
Dec 7, 2023

Conversation

AndrewPaglusch
Copy link
Owner

This update addresses a flaw where the script could re-ban an already banned user. This occurred because the script was assessing a user's stream history and concurrent streams for potential banning, even after identifying the user as already banned.

This update resolves the issue by adding a continue statement to skip the remaining loop iteration once a user is found to be already banned. This prevents the script from reassessing and reapplying the ban on the same user within the same iteration.

Redacted logs showing this happening:

2023-12-07 17:51:08 - WARNING - Validation failed on API response data. "MediaContainer"->"Metadata" missing (nobody streaming?)
2023-12-07 18:33:51 - WARNING - Validation failed on API response data. "MediaContainer"->"Metadata" missing (nobody streaming?)
2023-12-07 18:34:01 - WARNING - Validation failed on API response data. "MediaContainer"->"Metadata" missing (nobody streaming?)
2023-12-07 21:03:39 - INFO - Banning user FakeUser123 for streaming from more than 3 IP addresses over the previous 3 hours
2023-12-07 21:03:39 - INFO - Saved bans to disk
2023-12-07 21:03:39 - INFO - Killing all streams for FakeUser123
2023-12-07 21:03:39 - INFO - IP history for user FakeUser123:
2023-12-07 21:03:39 - INFO - 2023-12-07 09:03:44 - 123.456.100.25
2023-12-07 21:03:39 - INFO - 2023-12-07 19:56:35 - 123.456.102.188
2023-12-07 21:03:39 - INFO - 2023-12-07 20:42:58 - 123.456.74.162
2023-12-07 21:03:39 - INFO - 2023-12-07 21:03:39 - 123.456.26.126
2023-12-07 21:16:41 - INFO - Killing all streams for banned user FakeUser123
2023-12-07 21:16:42 - INFO - Banning user FakeUser123 for streaming from more than 3 IP addresses over the previous 3 hours
2023-12-07 21:16:42 - INFO - Saved bans to disk
2023-12-07 21:16:42 - INFO - Killing all streams for FakeUser123
2023-12-07 21:16:42 - INFO - IP history for user FakeUser123:
2023-12-07 21:16:42 - INFO - 2023-12-07 09:16:45 - 123.456.100.25
2023-12-07 21:16:42 - INFO - 2023-12-07 19:56:35 - 123.456.102.188
2023-12-07 21:16:42 - INFO - 2023-12-07 20:42:58 - 123.456.74.162
2023-12-07 21:16:42 - INFO - 2023-12-07 21:03:39 - 123.456.26.126

@AndrewPaglusch AndrewPaglusch merged commit 4cdf9fb into master Dec 7, 2023
1 check passed
@AndrewPaglusch AndrewPaglusch deleted the reban_bug branch December 7, 2023 22:58
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