bryancall opened a new issue, #13851:
URL: https://github.com/apache/trafficserver/issues/13851

   The `exclude` option on an SNI limiter is documented to exempt matching 
client IPs from rate limiting, but the plugin refuses their TLS handshake 
instead.
   
   The 
[docs](https://github.com/apache/trafficserver/blob/d6b47e7f447d9e07a7a6c67ea0a6e778c410d0e9/doc/admin-guide/plugins/rate_limit.en.rst?plain=1#L206-L209)
 say:
   
   > A list of IP CIDR ranges to exclude from any rate limiting. Any IP 
matching this list will not be rate limited, even if the SNI matches.
   
   The [ClientHello 
handler](https://github.com/apache/trafficserver/blob/d6b47e7f447d9e07a7a6c67ea0a6e778c410d0e9/plugins/experimental/rate_limit/sni_limiter.cc#L79-L86)
 does this for an excluded client:
   
   ```cpp
   if (limiter->exclude() && limiter->exclude()->contains(swoc::IPAddr(sock))) {
     Dbg(dbg_ctl, "Limiter on %s is excluded via List=%s", ...);
     TSUserArgSet(vc, gVCIdx, nullptr);
     TSVConnReenableEx(vc, TS_EVENT_ERROR);
   
     return TS_ERROR;
   }
   ```
   
   `TSVConnReenableEx(vc, TS_EVENT_ERROR)` is the same call the limiter uses to 
turn away a client that is over its limit, so an excluded client is treated as 
if it were always over the limit. The branch should continue the handshake with 
`TSVConnReenable(vc)`, like the path for an SNI with no limiter.
   
   To reproduce on master (d6b47e7f44), configure two SNIs with `limit: 1`, one 
of them with `exclude` pointing at a list containing `127.0.0.0/8`, and request 
each once over TLS from loopback. The excluded SNI gets no response (curl 
reports `000`) right after the plugin logs `Limiter on excluded.example.com is 
excluded via List=loopback`, while the other SNI returns 200.
   
   This has been there since #10559. I'm working on a fix with an autest.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to