-
Notifications
You must be signed in to change notification settings - Fork 687
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
https redirect doesn't occur when AuthService applied #4620
Labels
t:bug
Something isn't working
Comments
LanceEa
changed the title
http to https redirect doesn't occur when AuthService applied
https redirect doesn't occur when AuthService applied
Oct 13, 2022
LanceEa
changed the title
https redirect doesn't occur when AuthService applied
bug: https redirect doesn't occur when AuthService applied
Oct 13, 2022
LanceEa
changed the title
bug: https redirect doesn't occur when AuthService applied
https redirect doesn't occur when AuthService applied
Oct 13, 2022
LanceEa
pushed a commit
that referenced
this issue
Oct 13, 2022
Fix regression introduced in v3 series when Envoy was upgraded to a version after 1.20 (behavior change introduced). This commit restores the expected behavior that an https redirect will occur prior to calling the ext_authz service. fixes #4620 Signed-off-by: Lance Austin <laustin@datawire.io>
5 tasks
LanceEa
pushed a commit
that referenced
this issue
Oct 13, 2022
Fix regression introduced in v3 series when Envoy was upgraded to a version after 1.20 (behavior change introduced). This commit restores the expected behavior that an https redirect will occur prior to calling the ext_authz service. fixes #4620 Signed-off-by: Lance Austin <laustin@datawire.io>
LanceEa
pushed a commit
that referenced
this issue
Oct 14, 2022
Fix regression introduced in v3 series when Envoy was upgraded to a version after 1.20 (behavior change introduced). This commit restores the expected behavior that an https redirect will occur prior to calling the ext_authz service. fixes #4620 Signed-off-by: Lance Austin <laustin@datawire.io>
LanceEa
pushed a commit
that referenced
this issue
Oct 14, 2022
Fix regression introduced in v3 series when Envoy was upgraded to a version after 1.20 (behavior change introduced). This commit restores the expected behavior that an https redirect will occur prior to calling the ext_authz service. fixes #4620 Signed-off-by: Lance Austin <laustin@datawire.io>
LanceEa
pushed a commit
that referenced
this issue
Oct 15, 2022
Fix regression introduced in v3 series when Envoy was upgraded to a version after 1.20 (behavior change introduced). This commit restores the expected behavior that an https redirect will occur prior to calling the ext_authz service. fixes #4620 Signed-off-by: Lance Austin <laustin@datawire.io>
LanceEa
pushed a commit
that referenced
this issue
Oct 15, 2022
Fix regression introduced in v3 series when Envoy was upgraded to a version after 1.20 (behavior change introduced). This commit restores the expected behavior that an https redirect will occur prior to calling the ext_authz service. fixes #4620 Signed-off-by: Lance Austin <laustin@datawire.io>
LanceEa
pushed a commit
that referenced
this issue
Oct 16, 2022
Fix regression introduced in v3 series when Envoy was upgraded to a version after 1.20 (behavior change introduced). This commit restores the expected behavior that an https redirect will occur prior to calling the ext_authz service. fixes #4620 Signed-off-by: Lance Austin <laustin@datawire.io>
LanceEa
pushed a commit
that referenced
this issue
Oct 16, 2022
Fix regression introduced in v3 series when Envoy was upgraded to a version after 1.20 (behavior change introduced). This commit restores the expected behavior that an https redirect will occur prior to calling the ext_authz service. fixes #4620 Signed-off-by: Lance Austin <laustin@datawire.io>
LanceEa
pushed a commit
that referenced
this issue
Oct 16, 2022
Fix regression introduced in v3 series when Envoy was upgraded to a version after 1.20 (behavior change introduced). This commit restores the expected behavior that an https redirect will occur prior to calling the ext_authz service. fixes #4620 Signed-off-by: Lance Austin <laustin@datawire.io>
LanceEa
pushed a commit
that referenced
this issue
Oct 16, 2022
Fix regression introduced in v3 series when Envoy was upgraded to a version after 1.20 (behavior change introduced). This commit restores the expected behavior that an https redirect will occur prior to calling the ext_authz service. fixes #4620 Signed-off-by: Lance Austin <laustin@datawire.io>
LanceEa
pushed a commit
that referenced
this issue
Oct 17, 2022
Fix regression introduced in v3 series when Envoy was upgraded to a version after 1.20 (behavior change introduced). This commit restores the expected behavior that an https redirect will occur prior to calling the ext_authz service. fixes #4620 Signed-off-by: Lance Austin <laustin@datawire.io>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
By default, Emissary-ingress adds http->https redirect routes for every host and the wild-card host (Note: this behavior can be overridden on a
Host
. However, in the v3 series it no longer works when anAuthService
is applied because Envoy will try to call the service configured withext_authz
http filter prior to doing the http--> https redirect.Below is the investigation on the behavior change.
TL;DR;
Understanding Envoy Behavior Change with Timeline:
July 27, 2021
envoyproxy/envoy#17502
Issue outlining the fact that a DirectResponse Route (issue doesn't say it but redirect response is in the same category) should always call
Ext_Authz
. This happens because the following check:The
skip_check_
causes the ext_authz filter to be skipped and continue execution along to the next filter in the HTTP Filter chain. If we take a look at sample Envoy Configuration generated by Emissary-ingress:Based on the above ext_authz logic when the HCM finds the Route in our configuration with the
https_redirect
it gets passed to thisif (route == nullptr || route->routeEntry() == nullptr)
logic. Since we have a Route it will pass the first logical test since it is not a nullpty. The call toroute-->routeEntry() == nullptr
is always true when it is a DirectResponse or a RedirectResponse. This can be seen here:Because
routeEntry()
always returnsnullptr
it means thatPerRouteFlags{true /*skip_check_*/, false /*skip_request_body_buffering_*/}
is always returned, skipping the ext_authz filter and allowing the http-->https redirect.August 10th, 2021
The following PR
envoyproxy/envoy#17546 landed fixing the issue and changing Envoy behavior as of 1.20 (released on Oct. 5th 2021). Here you can see the changelog where it is mentioned:
https://www.envoyproxy.io/docs/envoy/v1.23.1/version_history/v1.20/v1.20.0#minor-behavior-changes.
The override flag that would have reverted to the old behavior was removed in Envoy 1.23 which is the current version of Envoy that is shipped with
v3.2.0
.How do we address this?
PerRouteFlags setting the skip rules for the
ext_authz
filter can be added to our http --> https redirect Routes when aAuthService
exist.We already provide a RouteSpecific toggle for a
Mapping
via thebypass_auth
flag but this would remove it for a whole route regardless of TLS or non-tls connection. Therefore, we would want it to be applied only to the RedirectRoutes that are added.An example can be found here:
https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/ext_authz_filter#per-route-configuration
The text was updated successfully, but these errors were encountered: