Listener components

Listener configuration overview

listener.Filter

[listener.Filter proto]

{
  "name": "...",
  "config": "{...}",
  "typed_config": "{...}"
}
name

(string, REQUIRED) The name of the filter to instantiate. The name must match a supported filter.

config

(Struct) Filter specific configuration which depends on the filter being instantiated. See the supported filters for further documentation.

Only one of config, typed_config may be set.

typed_config

(Any) Filter specific configuration which depends on the filter being instantiated. See the supported filters for further documentation.

Only one of config, typed_config may be set.

listener.FilterChainMatch

[listener.FilterChainMatch proto]

Specifies the match criteria for selecting a specific filter chain for a listener.

In order for a filter chain to be selected, ALL of its criteria must be fulfilled by the incoming connection, properties of which are set by the networking stack and/or listener filters.

The following order applies:

  1. Destination port.

  2. Destination IP address.

  3. Server name (e.g. SNI for TLS protocol),

  4. Transport protocol.

  5. Application protocols (e.g. ALPN for TLS protocol).

  6. Source type (e.g. any, local or external network).

  7. Source IP address.

  8. Source port.

For criteria that allow ranges or wildcards, the most specific value in any of the configured filter chains that matches the incoming connection is going to be used (e.g. for SNI www.example.com the most specific match would be www.example.com, then *.example.com, then *.com, then any filter chain without server_names requirements).

{
  "destination_port": "{...}",
  "prefix_ranges": [],
  "source_type": "...",
  "source_prefix_ranges": [],
  "source_ports": [],
  "server_names": [],
  "transport_protocol": "...",
  "application_protocols": []
}
destination_port

(UInt32Value) Optional destination port to consider when use_original_dst is set on the listener in determining a filter chain match.

prefix_ranges

(core.CidrRange) If non-empty, an IP address and prefix length to match addresses when the listener is bound to 0.0.0.0/:: or when use_original_dst is specified.

source_type

(listener.FilterChainMatch.ConnectionSourceType) Specifies the connection source IP match type. Can be any, local or external network.

source_prefix_ranges

(core.CidrRange) The criteria is satisfied if the source IP address of the downstream connection is contained in at least one of the specified subnets. If the parameter is not specified or the list is empty, the source IP address is ignored.

source_ports

(uint32) The criteria is satisfied if the source port of the downstream connection is contained in at least one of the specified ports. If the parameter is not specified, the source port is ignored.

server_names

(string) If non-empty, a list of server names (e.g. SNI for TLS protocol) to consider when determining a filter chain match. Those values will be compared against the server names of a new connection, when detected by one of the listener filters.

The server name will be matched against all wildcard domains, i.e. www.example.com will be first matched against www.example.com, then *.example.com, then *.com.

Note that partial wildcards are not supported, and values like *w.example.com are invalid.

Attention

See the FAQ entry on how to configure SNI for more information.

transport_protocol

(string) If non-empty, a transport protocol to consider when determining a filter chain match. This value will be compared against the transport protocol of a new connection, when it’s detected by one of the listener filters.

Suggested values include:

application_protocols

(string) If non-empty, a list of application protocols (e.g. ALPN for TLS protocol) to consider when determining a filter chain match. Those values will be compared against the application protocols of a new connection, when detected by one of the listener filters.

Suggested values include:

Attention

Currently, only TLS Inspector provides application protocol detection based on the requested ALPN values.

However, the use of ALPN is pretty much limited to the HTTP/2 traffic on the Internet, and matching on values other than h2 is going to lead to a lot of false negatives, unless all connecting clients are known to use ALPN.

Enum listener.FilterChainMatch.ConnectionSourceType

[listener.FilterChainMatch.ConnectionSourceType proto]

ANY

(DEFAULT) ⁣Any connection source matches.

LOCAL

⁣Match a connection originating from the same host.

EXTERNAL

⁣Match a connection originating from a different host.

listener.FilterChain

[listener.FilterChain proto]

A filter chain wraps a set of match criteria, an option TLS context, a set of filters, and various other parameters.

{
  "filter_chain_match": "{...}",
  "tls_context": "{...}",
  "filters": [],
  "use_proxy_proto": "{...}",
  "transport_socket": "{...}"
}
filter_chain_match

(listener.FilterChainMatch) The criteria to use when matching a connection to this filter chain.

tls_context

(auth.DownstreamTlsContext) The TLS context for this filter chain.

Attention

This field is deprecated. Use transport_socket with name tls instead. If both are set, transport_socket takes priority.

filters

(listener.Filter) A list of individual network filters that make up the filter chain for connections established with the listener. Order matters as the filters are processed sequentially as connection events happen. Note: If the filter list is empty, the connection will close by default.

use_proxy_proto

(BoolValue) Whether the listener should expect a PROXY protocol V1 header on new connections. If this option is enabled, the listener will assume that that remote address of the connection is the one specified in the header. Some load balancers including the AWS ELB support this option. If the option is absent or set to false, Envoy will use the physical peer address of the connection as the remote address.

transport_socket

(core.TransportSocket) Optional custom transport socket implementation to use for downstream connections. To setup TLS, set a transport socket with name tls and DownstreamTlsContext in the typed_config. If no transport socket configuration is specified, new connections will be set up with plaintext.

listener.ListenerFilterChainMatchPredicate

[listener.ListenerFilterChainMatchPredicate proto]

Listener filter chain match configuration. This is a recursive structure which allows complex nested match configurations to be built using various logical operators.

Examples:

  • Matches if the destination port is 3306.

destination_port_range:
 start: 3306
 end: 3307
  • Matches if the destination port is 3306 or 15000.

or_match:
  rules:
    - destination_port_range:
        start: 3306
        end: 3306
    - destination_port_range:
        start: 15000
        end: 15001
{
  "or_match": "{...}",
  "and_match": "{...}",
  "not_match": "{...}",
  "any_match": "...",
  "destination_port_range": "{...}"
}
or_match

(listener.ListenerFilterChainMatchPredicate.MatchSet) A set that describes a logical OR. If any member of the set matches, the match configuration matches.

Precisely one of or_match, and_match, not_match, any_match, destination_port_range must be set.

and_match

(listener.ListenerFilterChainMatchPredicate.MatchSet) A set that describes a logical AND. If all members of the set match, the match configuration matches.

Precisely one of or_match, and_match, not_match, any_match, destination_port_range must be set.

not_match

(listener.ListenerFilterChainMatchPredicate) A negation match. The match configuration will match if the negated match condition matches.

Precisely one of or_match, and_match, not_match, any_match, destination_port_range must be set.

any_match

(bool) The match configuration will always match.

Precisely one of or_match, and_match, not_match, any_match, destination_port_range must be set.

destination_port_range

(type.Int32Range) Match destination port. Particularly, the match evaluation must use the recovered local port if the owning listener filter is after an original_dst listener filter.

Precisely one of or_match, and_match, not_match, any_match, destination_port_range must be set.

listener.ListenerFilterChainMatchPredicate.MatchSet

[listener.ListenerFilterChainMatchPredicate.MatchSet proto]

A set of match configurations used for logical operations.

{
  "rules": []
}
rules

(listener.ListenerFilterChainMatchPredicate, REQUIRED) The list of rules that make up the set.

listener.ListenerFilter

[listener.ListenerFilter proto]

{
  "name": "...",
  "config": "{...}",
  "typed_config": "{...}",
  "filter_disabled": "{...}"
}
name

(string, REQUIRED) The name of the filter to instantiate. The name must match a supported filter.

config

(Struct) Filter specific configuration which depends on the filter being instantiated. See the supported filters for further documentation.

Only one of config, typed_config may be set.

typed_config

(Any) Filter specific configuration which depends on the filter being instantiated. See the supported filters for further documentation.

Only one of config, typed_config may be set.

filter_disabled

(listener.ListenerFilterChainMatchPredicate) Optional match predicate used to disable the filter. The filter is enabled when this field is empty. See ListenerFilterChainMatchPredicate for further examples.