-
Notifications
You must be signed in to change notification settings - Fork 360
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
OIDC SecurityPolicy: original authorization header removed #3396
Comments
cc @zhaohuabing |
EG OIDC enables |
@zhaohuabing any idea why the EnvoyPatchPolicy did not work |
@arkodg EnvoyPatchPolicy worked. It's just the Authorization header has been sanitized by the OAuth2 filter when the oauth2 filter is in the request path, and Envoy believes this is the right behavior :-)
|
Ah nice find ! So filter ordering may be useful here ? |
Filter ordering won't help here since the OAuth2 filter will remove this header no matter where it's in the chain. @denniskniep I'm curious why you use both a JWT added by your "frontend application" and a |
Thanks a lot for looking into this. There are at least two reasons why I want to do this:
In my case its really a jwt which is added to the request by the frontend application. |
@denniskniep thanks for detailing your use case! I agree that MFA (two or more layers of authentication) is a valid scenario here. Let's open an issue in Envoy upstream to see if a knob can be added to opt this out. |
@zhaohuabing the feature for envoy is merged. So basically this can be added now to gateway? |
@zetaab Yes :-) |
How are we handling backwards compatibility with current envoy proxy releases? Is there any common way, how this is done in envoy gateway? Or is xDS ignoring the new property when it is sent to older envoy proxy versions where it is not yet existing? |
@denniskniep Envoy Gateway can only guarantee a 1:1 support with Envoy Gateway version and Envoy Proxy version, which is highlighted in https://gateway.envoyproxy.io/v1.0.1/install/matrix/, others may work but we cannot guarantee it . |
There are two ways to add support to this in EG:
I prefer the second option because, it prevents users from being surprised by the OAuth2 filter deleting an existing authorization header. Envoy's default behavior seems not reasonable. |
+1 to 2. |
Description:
I use the OIDC SecurityPolicy to secure a route to an upstream application.
But the upstream application needs a different jwt token than issued by the envoy oauth2 filter. This jwt is added by the application frontend to the
authorization
header on every request.Envoy oauth2 filter overwrites this
authorization
header.Therefore I created an EnvoyPatchPolicy to set
forward_bearer_token
tofalse
(and also a Ticket to make it configurable in the SecurityPolicy CRD: #3395)The issue is that after setting
forward_bearer_token
tofalse
noauthorization
header is forwarded to the upstream application.When setting loglevel of envoy to debug then you can see the following logs:
Incoming Request with
authorization
header from application frontend:And after
skipping oauth flow due to valid hmac cookie
theauthorization
header is gone!Any Ideas?
Environment:
K8s Cluster
envoyproxy/gateway-dev:7863f81
envoyproxy/envoy:distroless-v1.29.2
The text was updated successfully, but these errors were encountered: