-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
tls_inspector needlessly injected, causing incorrect behavior #13601
Comments
tls_inspector was the only listener filter to set apln in the past, so auto tls_inspector injection is added. |
That's actually a bit more complicated. One of the application protocols in the example is As @howardjohn pointed out, configuring this filter chain to match only If you want to match only plaintext HTTP, that's the correct way to do it. |
@PiotrSikora From envoy's perspective, you are right. Envoy doesn't know the best strategy. I am proposing add the flag in api: let control plane decide if tls_inspector. |
If control plane is smart enough, it should set |
We are talking about a medium smart control plane - smart enough to set a flag but not smart enough for filter match raw buffer 🙂 We can easily set the tls inspector directly or possibly get the raw buffer working so I wouldn't do anything subpar to help us. Initially I thought the current behavior was wrong but now I am not so sure what the correct behavior is |
It sounds like there is a reasonable control plane fix, is this really just a documentation issue? |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions. |
Just a followup: we did the workaround in the control plane and shipped a major regression despite writing (what we thought were) extensive tests, caused by my favorite other issue #12572. So yes, a smart control plane could workaround this, but not Istio 🙂. This was our fault, but its also proving to be really hard to do the right thing |
Also, the behavior to inject it seems inconsistent. If I set my filter chain matches to have So if I don't set tls_inspector, Its essentially the same complaint I had in #12572 and #5355 (comment): changing one filter chain match has an outsized impact on every other match in the entire chain |
The logic in envoy/source/server/listener_impl.cc Line 41 in 22683a0
|
Without
That's indeed unfortunate, but the simple solution is to always include The
That's because authors of |
I would remove it but put the removal behind a feature flag. Then after a release we can remove it entirely. |
The less magic in config transformation by Envoy the better, so I'm in favor of that. |
It seems that we've reached consensus, thanks! @howardjohn does this work for Istio? @tbarrella could you take care of this? We need to add a runtime flag to guard auto-injection of TLS inspector (it requires adding runtime flag check in |
@PiotrSikora that will work for us, I think we will be fine with it auto injected or not by working around it in the control plane with explicit raw-buffer (except doing it right this time...). So it's not strictly required but it seems like the preferred behavior for us and others. |
Yep, I think I can do this |
Title: tls_inspector needlessly injected, causing incorrect behavior
Description:
When a filter chain is configured with: HTTP inspector, no tls inspector, a match on application_protocol, no match on transport_protocol, we get the following log:
adding listener '0.0.0.0:15006': filter chain match rules require TLS Inspector listener filter, but it isn't configured, trying to inject it (this might fail if Envoy is compiled without it)
This is incorrect - tls inspector should not be needed here, since the http inspector will add the application protocol. This is caused by the code here:
envoy/source/server/listener_impl.cc
Line 41 in 22683a0
I would expect in this case, no TLS inspector is added. As a meta comment, automatically injecting this seems inconsistent with Envoys "fail fast" mentality but probably hard to change the behavior now.
Please note this is note benign - normally we would not care about the tls inspector being added since at worst its a trivial performance impact. However, we have recently moved to using
ListenerFilterChainMatchPredicate
to selectively enable listener filters to allow server first protocols to succeed. Because this is automatically injected, these are timing out here, forcing us to explicitly add the tls inspector in all cases.Interestingly, we could just add
transport_protocol = "raw_buffer"
to the match, but then we will break all of our other matches due to #12572Repro steps:
This config will easily reproduce
The text was updated successfully, but these errors were encountered: