MEDIUM: tcp-rules: Warn if a track-sc* content rule doesn't depend on content
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 2 Oct 2020 09:48:57 +0000 (11:48 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 2 Oct 2020 13:50:26 +0000 (15:50 +0200)
commit2079a4ad36d0ea01ee2a91c7fc26baa335fd3747
tree61f99c1926700ff9656e263bb0587844431d4677
parent7ea509e15f6fe3390a969f6eec29d76b8732d3aa
MEDIUM: tcp-rules: Warn if a track-sc* content rule doesn't depend on content

The warning is only emitted for HTTP frontend. Idea is to encourage the usage of
"tcp-request session" rules to track counters that does not depend on the
request content. The documentation has been updated accordingly.

The warning is important because since the multiplexers were added in the
processing chain, the HTTP parsing is performed at a lower level. Thus parsing
errors are detected in the multiplexers, before the stream creation. In HTTP/2,
the error is reported by the multiplexer itself and the stream is never
created. This difference has a certain number of consequences, one of which is
that HTTP request counting in stick tables only works for valid H2 request, and
HTTP error tracking in stick tables never considers invalid H2 requests but only
invalid H1 ones. And the aim is to do the same with the mux-h1. This change will
not be done for the 2.3, but the 2.4. At the end, H1 and H2 parsing errors will
be caught by the multiplexers, at the session level. Thus, tracking counters at
the content level should be reserved for rules using a key based on the request
content or those using ACLs based on the request content.

To be clear, a warning will be emitted for the following rules :

  tcp-request content track-sc0 src
  tcp-request content track-sc0 src if ! { src 10.0.0.0/24 }
  tcp-request content track-sc0 src if { ssl_fc }

But not for the following ones :

  tcp-request content track-sc0 req.hdr(host)
  tcp-request content track-sc0 src if { req.hdr(host) -m found }
doc/configuration.txt
src/action.c