-
Notifications
You must be signed in to change notification settings - Fork 681
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
malformed authority header for ExtensionService #4278
Comments
It is likely Envoy is using the cluster name Contour creates (with slashes etc.) as the |
I would think this issue may apply to any |
@sunjayBhatia thanks for looking into this. I'm also using Contour to expose grpc-web services. I'm using |
If anyone needs a quick/dirty solution to this I wrote this for similar issues (typically involving uds): https://github.com/democratic-csi/csi-grpc-proxy which can be used to simply proxy the request and rewrites (unconditionally essentially) the EDIT: scratch that, the above project was created to explicitly deal with the uds scenario so has 0 support for ssl/https :( |
Is there an envoy bug we're aware of that has been created to address this issue? |
@sunjayBhatia would be the one to know here. |
the issue shouldn't be an Envoy one, rather how we set up the gRPC service to connect to the auth/rate limit extension services since we generate/use a cluster name that isn't a valid hostname, we should set the
see: contour/internal/envoy/v3/listener.go Lines 685 to 687 in 93d8020
Note on SNI/how to set the proper hostname:
|
Forgive the ignorance here (don't really have much experience with To me this value should be whatever is here: https://github.com/travisghansen/external-auth-server/blob/master/examples/contour.yaml#L41 (since I assume that's what's being used to dial) |
Contour configures clusters for k8s services (that are not ExternalName services) to use envoys EDS to discover addresses, so Envoy won’t use that DNS name to dial the auth service, rather the address from the services endpoints But yeah, when using cleartext gRPC we need a valid hostname since we have no SNI to use, that could very well be set to the service name/namespace if we choose |
Hey, any update for this one? We are currently using ProjectContour with EAS (both working great - tbh far exceeding our expectations) - but cannot update EAS to newest version because of this. |
This is planned for the upcoming release, I’ll be picking this up soon 👍🏽 |
- so that cluster name, which may not be a valid host, is not used - if SNI is set on ExtensionService, it is passed through as authority - otherwise, / is replaced with . in extension cluster name to be used as authority Fixes: projectcontour#4278 Signed-off-by: Sunjay Bhatia <[email protected]>
see #4587 if you want to leave some feedback or try it out early 👍🏽 |
- so that cluster name, which may not be a valid host, is not used - if SNI is set on ExtensionService, it is passed through as authority - otherwise, / is replaced with . in extension cluster name to be used as authority Fixes: #4278 Signed-off-by: Sunjay Bhatia <[email protected]>
What steps did you take and what happened:
I wrote an
AuthorizationServer
using Rust. In Rust, the main package to handle http2 connections is calledh2
, which happens to be a very strict implementation of the http2 protocol.I then registered my server as an
ExtensionService
When Envoy makes a request, the authority header is set to:
That is an invalid authority header according to the specs. As a result,
h2
refuses to handle the request as reported here a while agoWhat did you expect to happen:
A valid authority header is sent to the server. Maybe only the ExtensionService name, or the virtual host fqdn?
Anything else you would like to add:
I've tried with h2 and h2c protocols without any diffrence.
I also tried not providing a protocol to see if maybe a http1 request could be handled (Rust has utilities already to convert http1/grpc-web on the fly and it could work) but, in this case, no protocol is set and the server doesn't know what to do with the TCP request
Environment:
kubectl version
): 1.23/etc/os-release
): UbuntuThe text was updated successfully, but these errors were encountered: