Skip to content

Commit

Permalink
listener: deprecate use_proxy_proto (#14406)
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Barrella <tabarr@google.com>
  • Loading branch information
tbarrella authored Dec 18, 2020
1 parent 2a9bb4d commit c3e4a00
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 29 deletions.
6 changes: 5 additions & 1 deletion api/envoy/config/listener/v3/listener_components.proto
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ message FilterChain {
// 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.
google.protobuf.BoolValue use_proxy_proto = 4;
//
// This field is deprecated. Add a
// :ref:`PROXY protocol listener filter <config_listener_filters_proxy_protocol>`
// explicitly instead.
google.protobuf.BoolValue use_proxy_proto = 4 [deprecated = true];

// [#not-implemented-hide:] filter chain metadata.
core.v3.Metadata metadata = 5;
Expand Down
12 changes: 2 additions & 10 deletions api/envoy/config/listener/v4alpha/listener_components.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions configs/envoy_double_proxy.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
protocol: {{protocol}}
address: {{address}}
port_value: {{port_value}}
{% if proxy_proto %}
listener_filters:
- name: envoy.filters.listener.proxy_protocol
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.listener.proxy_protocol.v3.ProxyProtocol
{% endif %}
filter_chains:
- filter_chain_match: {}
{% if tls %}
Expand All @@ -23,9 +29,6 @@
- h2
- http/1.1
{% endif %}
{% if proxy_proto %}
use_proxy_proto: true
{%endif -%}
filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
Expand Down
9 changes: 6 additions & 3 deletions configs/envoy_front_proxy.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
protocol: {{protocol}}
address: {{address}}
port_value: {{port_value}}
{% if proxy_proto %}
listener_filters:
- name: envoy.filters.listener.proxy_protocol
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.listener.proxy_protocol.v3.ProxyProtocol
{% endif %}
filter_chains:
{% if tls %}
- transport_socket:
Expand All @@ -28,9 +34,6 @@
#double proxy configuration.
verify_certificate_hash: "0000000000000000000000000000000000000000000000000000000000000000"
{% endif %}
{%if proxy_proto%}
use_proxy_proto: true
{%endif%}
{%endif %}
filters:
- name: envoy.filters.network.http_connection_manager
Expand Down
7 changes: 5 additions & 2 deletions configs/google-vrp/envoy-edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ static_resources:
address: 0.0.0.0
port_value: 10000
per_connection_buffer_limit_bytes: 32768 # 32 KiB
# Uncomment if Envoy is behind a load balancer that exposes client IP address using the PROXY protocol.
# listener_filters:
# - name: envoy.filters.listener.proxy_protocol
# typed_config:
# "@type": type.googleapis.com/envoy.extensions.filters.listener.proxy_protocol.v3.ProxyProtocol
filter_chains:
- transport_socket:
name: envoy.transport_sockets.tls
Expand All @@ -36,8 +41,6 @@ static_resources:
tls_certificates:
- certificate_chain: { filename: "certs/servercert.pem" }
private_key: { filename: "certs/serverkey.pem" }
# Uncomment if Envoy is behind a load balancer that exposes client IP address using the PROXY protocol.
# use_proxy_proto: true
filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
Expand Down
6 changes: 4 additions & 2 deletions docs/root/configuration/best_practices/_include/edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ static_resources:
listener_filters:
- name: "envoy.filters.listener.tls_inspector"
typed_config: {}
# Uncomment if Envoy is behind a load balancer that exposes client IP address using the PROXY protocol.
# - name: envoy.filters.listener.proxy_protocol
# typed_config:
# "@type": type.googleapis.com/envoy.extensions.filters.listener.proxy_protocol.v3.ProxyProtocol
per_connection_buffer_limit_bytes: 32768 # 32 KiB
filter_chains:
- filter_chain_match:
Expand All @@ -46,8 +50,6 @@ static_resources:
tls_certificates:
- certificate_chain: { filename: "certs/servercert.pem" }
private_key: { filename: "certs/serverkey.pem" }
# Uncomment if Envoy is behind a load balancer that exposes client IP address using the PROXY protocol.
# use_proxy_proto: true
filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
Expand Down
2 changes: 1 addition & 1 deletion docs/root/configuration/http/http_conn_man/headers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ Supported variable names are:
.. note::

This may not be the physical remote address of the peer if the address has been inferred from
:ref:`proxy proto <envoy_v3_api_field_config.listener.v3.FilterChain.use_proxy_proto>` or :ref:`x-forwarded-for
:ref:`Proxy Protocol filter <config_listener_filters_proxy_protocol>` or :ref:`x-forwarded-for
<config_http_conn_man_headers_x-forwarded-for>`.

%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%
Expand Down
8 changes: 4 additions & 4 deletions docs/root/configuration/observability/access_log/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ The following command operators are supported:
.. note::

This may not be the physical remote address of the peer if the address has been inferred from
:ref:`proxy proto <envoy_v3_api_field_config.listener.v3.FilterChain.use_proxy_proto>` or :ref:`x-forwarded-for
:ref:`Proxy Protocol filter <config_listener_filters_proxy_protocol>` or :ref:`x-forwarded-for
<config_http_conn_man_headers_x-forwarded-for>`.

%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%
Expand All @@ -332,7 +332,7 @@ The following command operators are supported:
.. note::

This may not be the physical remote address of the peer if the address has been inferred from
:ref:`proxy proto <envoy_v3_api_field_config.listener.v3.FilterChain.use_proxy_proto>` or :ref:`x-forwarded-for
:ref:`Proxy Protocol filter <config_listener_filters_proxy_protocol>` or :ref:`x-forwarded-for
<config_http_conn_man_headers_x-forwarded-for>`.

%DOWNSTREAM_DIRECT_REMOTE_ADDRESS%
Expand All @@ -342,7 +342,7 @@ The following command operators are supported:
.. note::

This is always the physical remote address of the peer even if the downstream remote address has
been inferred from :ref:`proxy proto <envoy_v3_api_field_config.listener.v3.FilterChain.use_proxy_proto>`
been inferred from :ref:`Proxy Protocol filter <config_listener_filters_proxy_protocol>`
or :ref:`x-forwarded-for <config_http_conn_man_headers_x-forwarded-for>`.

%DOWNSTREAM_DIRECT_REMOTE_ADDRESS_WITHOUT_PORT%
Expand All @@ -352,7 +352,7 @@ The following command operators are supported:
.. note::

This is always the physical remote address of the peer even if the downstream remote address has
been inferred from :ref:`proxy proto <envoy_v3_api_field_config.listener.v3.FilterChain.use_proxy_proto>`
been inferred from :ref:`Proxy Protocol filter <config_listener_filters_proxy_protocol>`
or :ref:`x-forwarded-for <config_http_conn_man_headers_x-forwarded-for>`.

%DOWNSTREAM_LOCAL_ADDRESS%
Expand Down
1 change: 1 addition & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Deprecated
* compression: the fields :ref:`content_length <envoy_v3_api_field_extensions.filters.http.compressor.v3.Compressor.content_length>`, :ref:`content_type <envoy_v3_api_field_extensions.filters.http.compressor.v3.Compressor.content_type>`, :ref:`disable_on_etag_header <envoy_v3_api_field_extensions.filters.http.compressor.v3.Compressor.disable_on_etag_header>`, :ref:`remove_accept_encoding_header <envoy_v3_api_field_extensions.filters.http.compressor.v3.Compressor.remove_accept_encoding_header>` and :ref:`runtime_enabled <envoy_v3_api_field_extensions.filters.http.compressor.v3.Compressor.runtime_enabled>` of the :ref:`Compressor <envoy_v3_api_msg_extensions.filters.http.compressor.v3.Compressor>` message have been deprecated in favor of :ref:`response_direction_config <envoy_v3_api_field_extensions.filters.http.compressor.v3.Compressor.response_direction_config>`.
* formatter: :ref:`text_format <envoy_v3_api_field_config.core.v3.SubstitutionFormatString.text_format>` is now deprecated in favor of :ref:`text_format_source <envoy_v3_api_field_config.core.v3.SubstitutionFormatString.text_format_source>`. To migrate existing text format strings, use the :ref:`inline_string <envoy_v3_api_field_config.core.v3.DataSource.inline_string>` field.
* gzip: :ref:`HTTP Gzip filter <config_http_filters_gzip>` is rejected now unless explicitly allowed with :ref:`runtime override <config_runtime_deprecation>` `envoy.deprecated_features.allow_deprecated_gzip_http_filter` set to `true`.
* listener: :ref:`use_proxy_proto <envoy_v3_api_field_config.listener.v3.FilterChain.use_proxy_proto>` has been deprecated in favor of adding a :ref:`PROXY protocol listener filter <config_listener_filters_proxy_protocol>` explicitly.
* logging: the `--log-format-prefix-with-location` option is removed.
* ratelimit: the :ref:`dynamic metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.dynamic_metadata>` action is deprecated in favor of the more generic :ref:`metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.metadata>` action.
* stats: the `--use-fake-symbol-table` option is removed.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/server/listener_manager_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4745,7 +4745,7 @@ TEST_F(ListenerManagerImplForInPlaceFilterChainUpdateTest,
}

TEST_F(ListenerManagerImplForInPlaceFilterChainUpdateTest,
TraditionalUpdateIfImplicitProxyProtocolChanges) {
DEPRECATED_FEATURE_TEST(TraditionalUpdateIfImplicitProxyProtocolChanges)) {

EXPECT_CALL(*worker_, start(_));
manager_->startWorkers(guard_dog_);
Expand Down

0 comments on commit c3e4a00

Please sign in to comment.