External Authorization

The external authorization service configuration configuration overview.

config.filter.http.ext_authz.v2alpha.ExtAuthz

[config.filter.http.ext_authz.v2alpha.ExtAuthz proto]

External Authorization filter calls out to an external service over either:

  1. gRPC Authorization API defined by CheckRequest.
  2. Raw HTTP Authorization server by passing the request headers to the service.

A failed check will cause this filter to close the HTTP request normally with 403 (Forbidden), unless a different status code has been indicated in the authorization response.

{
  "grpc_service": "{...}",
  "http_service": "{...}",
  "failure_mode_allow": "..."
}
grpc_service

(core.GrpcService) The external authorization gRPC service configuration. The default timeout is set to 200ms by this filter.

Only one of grpc_service, http_service may be set.

http_service

(config.filter.http.ext_authz.v2alpha.HttpService) The external authorization HTTP service configuration. The default timeout is set to 200ms by this filter.

Only one of grpc_service, http_service may be set.

failure_mode_allow
(bool) The filter’s behaviour in case the external authorization service does not respond back. When it is set to true, Envoy will also allow traffic in case of an error occurs during the authorization process. Defaults to false.

config.filter.http.ext_authz.v2alpha.HttpService

[config.filter.http.ext_authz.v2alpha.HttpService proto]

External Authorization filter calls out to an upstream authorization server by passing the raw HTTP request headers to the server. This allows the authorization service to take a decision whether the request is authorized or not.

A successful check allows the authorization service adding or overriding headers from the original request before dispatching it to the upstream. This is done by configuring which headers in the authorization response should be sent to the upstream. See allowed_authorization_headers bellow.

A failed check will cause this filter to close the HTTP request with 403 (Forbidden), unless a different status code has been indicated by the authorization server via response headers.

If an error happens during the checking process, two situations may occur depending on the filter’s configuration:

  1. When failure_mode_allow is true, traffic will be allowed in the presence of an error. This includes any of the HTTP 5xx errors, or a communication failure between the filter and the authorization server.
  2. When failure_mode_allow is false, the filter will always return a Forbidden response to the client. It will not allow traffic to the upstream in the presence of an error. This includes any of the HTTP 5xx errors, or a communication failure between the filter and the authorization server.

Note that filter will produce stats on error. See Statistics at configuration overview.

{
  "server_uri": "{...}",
  "path_prefix": "...",
  "allowed_authorization_headers": [],
  "allowed_request_headers": [],
  "authorization_headers_to_add": []
}
server_uri
(core.HttpUri) Sets the HTTP server URI which the authorization requests must be sent to.
path_prefix
(string) Sets an optional prefix to the value of authorization request header Path.
allowed_authorization_headers
(string) Sets a list of headers that can be sent from the authorization server to the upstream service, or to the downstream client when present in the authorization response. Note that a matched request header will have its value overridden by the ones sent from the authorization server.
allowed_request_headers
(string) Sets a list of headers that should be sent from the filter to the authorization server when they are also present in the client request. Note that Content-Length, Authority, Method and Path are always dispatched to the authorization server by default. The message will not contain body data and the Content-Length will be set to zero.
authorization_headers_to_add
(core.HeaderValue) Sets a list of headers and their values that will be added to the request to external authorization server. Note that these will override the headers coming from the downstream.