External Authorization

The external authorization network filter calls an external authorization service to check if the incoming request is authorized or not. If the request is deemed unauthorized by the network filter then the connection will be closed.

Tip

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

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

The network filter, gRPC service, can be configured as follows. You can see all the configuration options at Network filter.

Example

A sample filter configuration could be:

  1. filters:
  2. - name: envoy.ext_authz
  3. config:
  4. stat_prefix: ext_authz
  5. grpc_service:
  6. envoy_grpc:
  7. cluster_name: ext-authz
  8. clusters:
  9. - name: ext-authz
  10. type: static
  11. http2_protocol_options: {}
  12. load_assignment:
  13. cluster_name: ext-authz
  14. endpoints:
  15. - lb_endpoints:
  16. - endpoint:
  17. address:
  18. socket_address:
  19. address: 127.0.0.1
  20. port_value: 10003

Statistics

The network filter outputs statistics in the config.ext_authz. namespace.

NameTypeDescription
totalCounterTotal responses from the filter.
errorCounterTotal errors contacting the external service.
deniedCounterTotal responses from the authorizations service that were to deny the traffic.
failure_mode_allowedCounterTotal requests that were error(s) but were allowed through because of failure_mode_allow set to true.
okCounterTotal responses from the authorization service that were to allow the traffic.
cx_closedCounterTotal connections that were closed.
activeGaugeTotal currently active requests in transit to the authorization service.