External Authorization

The external authorization HTTP filter calls an external gRPC service to check if the incoming HTTP request is authorized or not. If the request is deemed unauthorized then the request will be denied with 403 (Forbidden) response.

Tip

It is recommended that this filter is configured first in the filter chain so that requests are authorized prior to the rest of filters processing the request.

The content of the requests that are passed to an authorization service is specified by CheckRequest.

The HTTP filter, using a gRPC service, can be configured as follows. You can see all the configuration options at HTTP filter.

Example

A sample filter configuration could be:

  1. http_filters:
  2. - name: envoy.ext_authz
  3. config:
  4. grpc_service:
  5. envoy_grpc:
  6. cluster_name: ext-authz
  7. clusters:
  8. - name: ext-authz
  9. type: static
  10. http2_protocol_options: {}
  11. hosts:
  12. - socket_address: { address: 127.0.0.1, port_value: 10003 }

Statistics

The HTTP filter outputs statistics in the cluster..ext_authz. namespace.

NameTypeDescription
okCounterTotal responses from the filter.
errorCounterTotal errors contacting the external service.
deniedCounterTotal responses from the authorizations service that were to deny the traffic.
failure_mode_allowCounterTotal requests that were error(s) but were allowed through because of failure_mode_allow set to true.