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

Client inactivity timeout (sockstress) #772

Closed
krizhanovsky opened this issue Jul 21, 2017 · 0 comments
Closed

Client inactivity timeout (sockstress) #772

krizhanovsky opened this issue Jul 21, 2017 · 0 comments

Comments

@krizhanovsky
Copy link
Contributor

krizhanovsky commented Jul 21, 2017

Currently we don't limit how long a client can keep open connection without doing anything, so following command:

    $ nc tempesta 80

keeps the open connection until TCP keepalive closes it. Current client_header_timeout and client_body_timeout limits don't affect the behaviour as well as keepalive_timeout. This issues isn't a crucial since we have concurrent_connections, so an attacker can't efficiently launch sockstress attack, but it's still not desirable to spend resources.

In general, keepalive_timeout parameter shall limit period of client connection inactivity starting from a connection establishing, not from a first message as it seems to be now. It's different from client_header_timeout which defines time required to receive a full HTTP header (i.e. if an attacker sends 1 byte a time, it still will be blocked). However, it's exactly the same as client_body_timeout (timeout between data chunks), but it should start just after connection establishing. So keepalive_timeout option will overlap client_body_timeout. Meantime, attacker can send 1 byte of body a time and pass the limits, so client_body_timeout must be reworked to limit total time required to build whole message body. With http_body_chunk_cnt limit it efficiently fights against slow HTTP. However, http_body_chunk_cnt is not enough, because it limits HTTP chunks and an attacker still can slowly send for example small IP fragments.

Also see Apache mod_reqtimeout.

@krizhanovsky krizhanovsky added this to the 1.0 WebOS milestone Jul 21, 2017
@krizhanovsky krizhanovsky changed the title Frang: client connection timeout (sockstress) Client inactivity timeout (sockstress) Jul 22, 2017
@krizhanovsky krizhanovsky modified the milestones: backlog, 0.6 KTLS Jan 9, 2018
@krizhanovsky krizhanovsky modified the milestones: 0.6 KTLS, 0.7 HTTP/2 Jul 15, 2018
aleksostapenko added a commit that referenced this issue Jul 18, 2018
 Fix #772: Change 'keepalive' and 'client_body' timeouts applying.
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

3 participants