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

Custom HTTP status codes for block action #1063

Open
vankoven opened this issue Sep 6, 2018 · 1 comment
Open

Custom HTTP status codes for block action #1063

vankoven opened this issue Sep 6, 2018 · 1 comment

Comments

@vankoven
Copy link
Contributor

vankoven commented Sep 6, 2018

Modern browsers try to reestablish and repeat request in case of network errors. When we block a client with real browser, we should send 5xx or 4xx error instead of silently close the client connection. Here is an article showing the issue. In article researcher try to block client with specific Referer: header. After connection is closed, both Firefox and Chrome tries to repeat the request several times. And both drop the Referer: headed after several tries. One of comments to the article says, that Chrome in some elder version used to resend request after 5xx response codes.

Tempesta should silently close connection to usual bots and send error response to real browsers and full-browser botnets to effectively mitigate DDoS attacks.

@vankoven vankoven added this to the 1.0 Beta milestone Sep 6, 2018
@krizhanovsky
Copy link
Contributor

krizhanovsky commented Sep 6, 2018

The issue seems invalid for me. Firstly, we have a configuration option to drop a client connection silently or send an HTTP response, so if a user don't want to face the problem described in the article, then they just should use block_action attack reply configuration. Secondly, how can we understand whether the client is a real browser or not? We do a lot to differentiate a real clients from bots, e.g. using Cookie or JS challenges, and surely we don't want to terminate innocent client connections any way.

UPD. Actually, there is a problem that we can not send custom HTTP responses, e.g. 204 and people suggest in the article. So I think the issue should be reformulated as a requirement to point out desirable HTTP code for block_action ... reply. I think the task is linked with #856 (HTTP redirects).

UPD The response codes must be configurable as part of HTTPtables, see #1108.

Also please add a complete configuration example to https://github.com/tempesta-tech/tempesta/wiki/Handling-clients#error-responses because now it's unclear for a user where exactly the option should be used (Nginx docs say about context for this).

@krizhanovsky krizhanovsky modified the milestones: 1.0 Beta, 0.7 HTTP/2 Sep 6, 2018
@krizhanovsky krizhanovsky changed the title Don't silently drop connections from real brrowser clients Custom HTTP status codes for block action Sep 6, 2018
@krizhanovsky krizhanovsky modified the milestones: 1.xx TBD, backlog Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants