-
Notifications
You must be signed in to change notification settings - Fork 104
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
JavaScript challenge usability #1102
Comments
The upper limit is protection against scripting. Imagine that there is no upper limit and the JS challenge sets only initial delay. Then the simple script below will pass the JS challenge without actually solving the JS challenge:
The main goal of the JS challenge is to mitigate asymmetric DDoS: force attacker to use more resources than Tempesta has. If JS Challenge can be bridged without solving JS quiz, then the feature will harm legitimate users without any security improvement. I was thinking on JS limits more and came to conclusion, that we're setting them in a wrong way. Current limits may be bridged with simple scripting with 100% success rate. The issue is in the upper limit configuration, from #536:
Say we have JS limits:
This will have 100% success rate, since Tempesta is configured to wait for The issue happen, because allowed time interval to pass the challenge has:
To solve the issue the upper border must also be generated randomly for each client. Thus we should update
Attacker chances to pass the challenge with simple scripting is |
Detailed information in my comment to #1102 issue
Detailed information in my comment to #1102 issue
The issue described in #1102 (comment) was resolved, but it has nothing to do with |
Detailed information in my comment to #1102 issue # Conflicts: # etc/tempesta_fw.conf
During the JSCH testing I observerd annoying flood in dmesg of following records:
|
Just hit the JSCH problem with configuration
Accessed a web site protected by Tempesta FW - my browsers accessed it normally as expected. But when I accessed it the next day, my IP was blocked since the browser accessed the site with the same cookie, which was considered by Tempesta as malicious due to expired timestamp inside the cookie. Setting option This is a configuration problem and the run script should care about it, not Tempesta FW. The script should check the configuration and print a waning, ideally with link to the wiki https://github.com/tempesta-tech/tempesta/wiki/Sticky-Cookie#session-lifetime Also update the wiki to say explicitly that Max-Age cookie option is required to correct site operation. |
There is annoying warning
The problem with the warning is that there is no such |
We just received a user claim on failed cookie challenge with configuration without Also need to deploy the next version of our web site with JSCH to well test it on real client requests. TBD: how to manage JSCH according to GDPR? In particular how can we provide a user a choice whether to store the cookie and what should we do if we have |
#1746 has improved the feature usability issue from the user request, so I move the task back to 0.8. |
- Add simple parsing and checking of cookie options. Now "Path" and "Max-Age" options are disallowed, because they are explicitly set by tempesta. We should prevent it's duplication by user. - Set "Max-Age" option to "sess_lifetime" value, to prevent client blocking because cookie expired. - Fix calculation of max_limit for JS callenge. Closes #1102
- Add simple parsing and checking of cookie options. Now "Path" and "Max-Age" options are disallowed, because they are explicitly set by tempesta. We should prevent it's duplication by user. - Set "Max-Age" option to "sess_lifetime" value, to prevent client blocking because cookie expired. - Fix calculation of max_limit for JS callenge. - Fix calculation of min time according Wiki Closes #1102
I think we should just abandon the upper level time limit. As it was commented, bots still can make a sleep within an allowed time range, but the upper bound complicates administration and the code support. The Tempesta JS challenge must solve the only one task - to slow down the bots. I.e. it's a pure L7 DDoS mitigation. Modern bots can do much more than random sleep, see for example how ZenRows bypass Cloudflare. This is the task for more sophisticated ML logic and much more advanced JavaScript code, which is scheduled for the enterprise version. |
After discussion we decide to save upper level limit |
- Add simple parsing and checking of cookie options. Now "Path" and "Max-Age" options are disallowed, because they are explicitly set by tempesta. We should prevent it's duplication by user. - Set "Max-Age" option to "sess_lifetime" value, to prevent client blocking because cookie expired. - Fix calculation of max_limit for JS callenge. - Fix calculation of min time according Wiki Closes #1102
I created https://github.com/tempesta-tech/tempesta-tech.com/issues/93 for this |
After discussion:
|
Closed by #2025 |
Upper timeout bound
It seems if a client receives JS challenge and just closes a browser (quite probable) or reply with some significant delay (unlikely since we have large enough timeout), then it remains blocked. The reason for the upper limit is unclear.
The cookie must have
Max-Age
attribute equal to the upper limit. It's to be discussed should we block cookies after the Max-Age and the upper timeout bound or not. After all the main reason for the JS challenge is to slow bots down... It seems thatMax-Age
should be equal to our internal configuration sess_lifetime.Better user experience
At the moment we send JS challenge on each request. While it was OK with Cookie challenge since a user doesn't see the redirects, it makes user experience significantly worse for JS challenge since all users now see the message about the browser verification. We must send JS challenge only if a users is suspisious, e.g. exceeded an HTTP requests rate soft limit. This is essentialy #598 (comment) , so the task depends on #598.Moved to #488Rework filtration logic
Resolve the comment in
tfw_http_sess_check_redir_mark()
from #1746 :Docs
Please update the Wiki https://github.com/tempesta-tech/tempesta/wiki/Sticky-Cookie#javascript-challenge on the task completion. Following topics must be covered: motivation for the upper bound,
Max-Age
description and advices how to chose the duration correctly, make configuration examples and use cases.The text was updated successfully, but these errors were encountered: