ext_authz: Use 403 as default for denied response#18010
ext_authz: Use 403 as default for denied response#18010mattklein123 merged 6 commits intoenvoyproxy:mainfrom dio:fix-ext_authz-unknown-denied-response-status
Conversation
Before this, when a gRPC server sends out DeniedResponse as a check response for a request but without setting the HttpResponse.DeniedResponse.Status, HTTP ext_authz filter translates that as "0" (empty/unknown HTTP status code). This patch makes sure we reply with a valid 403 Forbidden HTTP status code (the current default status code for denied response). Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
|
/assign @esmet |
yanavlasov
left a comment
There was a problem hiding this comment.
Should we make the status to not be required with this change?
/wait
|
Lets update the comment on status to make it extra clear that the default is 403. The language only sort of suggests this. |
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
|
/lgtm api |
|
Thanks, @yanavlasov, @esmet, and @markdroth for the review! |
|
Looks good, and I think it needs main merged in to fix the linux_x64 api_compat job. |
…wn-denied-response-status
|
cc. @envoyproxy/senior-maintainers if you want to take a look. Thanks! |
mattklein123
left a comment
There was a problem hiding this comment.
LGTM with small doc nit, thanks.
/wait
| * dynamic forward proxy: fixing a validation bug where san and sni checks were not applied setting :ref:`http_protocol_options <envoy_v3_api_msg_extensions.upstreams.http.v3.HttpProtocolOptions>` via :ref:`typed_extension_protocol_options <envoy_v3_api_field_config.cluster.v3.Cluster.typed_extension_protocol_options>`. | ||
| * ext_authz: fix the ext_authz filter to correctly merge multiple same headers using the ',' as separator in the check request to the external authorization service. | ||
| * ext_authz: the network ext_authz filter now correctly sets dynamic metdata returned by the authorization service for non-OK responses. This behavior now matches the http ext_authz filter. | ||
| * ext_authz: fix the HTTP ext_authz filter to response with ``403 Forbidden`` when a gRPC auth server sends a denied check respond with empty HTTP status code. |
There was a problem hiding this comment.
| * ext_authz: fix the HTTP ext_authz filter to response with ``403 Forbidden`` when a gRPC auth server sends a denied check respond with empty HTTP status code. | |
| * ext_authz: fix the HTTP ext_authz filter to respond with ``403 Forbidden`` when a gRPC auth server sends a denied check response with an empty HTTP status code. |
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Commit Message: Before this, when a gRPC server sends out
DeniedResponseas a check response for a request but without setting theHttpResponse.DeniedResponse.Status, HTTPext_authzfilter translates that as0(empty/unknown HTTP status code). This patch makes sure we reply with a valid403 ForbiddenHTTP status code (the current default status code for denied response).Additional Description: When building a minimal gRPC auth server I found that it is a bit confusing for
CheckResponse_DeniedResponsewhen you have already setCheckResponse.Statuswithcode.Code_PERMISSION_DENIEDbut then you addedCheckResponse.HttpResponse. In the current code, it is required to setCheckResponse.HttpResponse.Status, if not it will be sending Unknown (0) status code.envoy/api/envoy/service/auth/v3/external_auth.proto
Lines 49 to 51 in cc1d41e
The above docs excerpt suggests that if we skip on specifying it, it will be 403.
Risk Level: Low
Testing: Added
Docs Changes: N/A
Release Notes: Added
Platform Specific Features: N/A
Signed-off-by: Dhi Aurrahman dio@rockybars.com