-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Ext Authz (gRPC): Plugin denies when failure_mode_allow set to true and Auth Server responses 5xx #10158
Comments
@gkleiman is going to fix this. |
@kikogolk are you sure that your ext authz service is responding with a 503? I tried this using a very simple HTTP/2 server that always responds with a 503 and an empty response body and I couldn't reproduce the behavior you describe. In my tests Envoy will allow the request and increase both the |
@kikogolk could you try to run envoy with e.g.
Try to find log lines similar to:
These lines:
denote we received 500 HTTP status code from the "authorization" server. Thanks! |
Hi all! Sorry for the misunderstanding, but maybe my description was not good enough. My issue is related to the gRPC Auth Server plugin, not the HTTP one. When I said the Authz Server responses 5xx, it was the error enclosed inside the CheckResponse gRPC message. I mean, the gRPC Authz Server is responding with a Denied Check Response, setting the Http Status code to 5xx. Here you have some logs I captured from my silly gRPC Auth Server. The CheckRequest received from Envoy:
And the CheckResponse returned to Envoy (note the HttpStatus code was set to "ServiceUnavailable"):
And the logs from Envoy:
That is why I started the post saying maybe I was not understanding properly the behavior of the "failure_mode_allow" parameter. My gRPC Auth server is responding Denied with enclosed Http Status 5xx but, as I understand how failure_mode_allow works, the request should be routed, but it is rejected by Envoy instead. Sorry for the misunderstanding and wasting your time. Thanks a lot. |
Yes. I think when your auth-server is able to send back a "successful response", it will fall into one of two possible states: "OK" or "Denied". The failure itself: if the HTTP status code of the auth-server's response is not 200 (that's why @gkleiman tried to simulate the failure by sending the HTTP status code to 503), while in your case, envoy received 200 from the auth-server:
|
According to the
@dio I think we can probably close this issue unless we want to improve some documentation. |
@kikogolk I'm closing this. But I encourage you to help with PR/issue to improve the docs. Thanks! |
Title: Ext Authz (gRPC): Plugin denies when failure_mode_allow set to true and Auth Server responses 5xx
Description:
Hi!
Envoy version: v1.13.0
Not sure if this is an issue or just I misunderstood the meaning of the "failure_mode_allow" parameter in the HTTP External Authorization plugin (using grpc_service).
From following link:
https://www.envoyproxy.io/docs/envoy/v1.13.0/api-v2/config/filter/http/ext_authz/v2/ext_authz.proto#envoy-api-msg-config-filter-http-ext-authz-v2-extauthz
When failure_mode_allow is set to true, I am afraid the request is denied even when the External Authz server returns HTTP 5xx error. However it is working as stated in the description when the connection fails or timeout (i.e request is accepted and passed to router plugin). Checking the code, it seems the "http_service" is routing the request (as described in the documentation) but not happening the same in "grpc_service".
This is the Envoy's filter configuration I am using:
When sending a request that Auth Server denies:
When Auth Server query fails due to timeout (upstream answers correctly):
I was checking this already closed issue: #4124 . Not sure then if it is an documentation issue or I am misunderstanding the proper behavior.
Thanks a lot!
The text was updated successfully, but these errors were encountered: