From 7fc5e2abbc0cd246511c420818c91db4ce893bb7 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Thu, 19 Mar 2020 00:13:13 +0000 Subject: [PATCH 01/15] SNI-based dynamic forward proxy filter Signed-off-by: Lizan Zhou --- CODEOWNERS | 2 + api/BUILD | 2 + api/docs/BUILD | 1 + .../sni_dynamic_forward_proxy/v2alpha/BUILD | 12 ++ .../v2alpha/sni_dynamic_forward_proxy.proto | 33 ++++ .../sni_dynamic_forward_proxy/v3alpha/BUILD | 13 ++ .../v3alpha/sni_dynamic_forward_proxy.proto | 35 ++++ docs/root/intro/version_history.rst | 1 + .../sni_dynamic_forward_proxy/v2alpha/BUILD | 12 ++ .../v2alpha/sni_dynamic_forward_proxy.proto | 33 ++++ .../sni_dynamic_forward_proxy/v3alpha/BUILD | 13 ++ .../v3alpha/sni_dynamic_forward_proxy.proto | 35 ++++ .../clusters/dynamic_forward_proxy/cluster.cc | 16 +- source/extensions/extensions_build_config.bzl | 1 + .../network/sni_dynamic_forward_proxy/BUILD | 39 +++++ .../sni_dynamic_forward_proxy/config.cc | 41 +++++ .../sni_dynamic_forward_proxy/config.h | 32 ++++ .../sni_dynamic_forward_proxy/proxy_filter.cc | 72 ++++++++ .../sni_dynamic_forward_proxy/proxy_filter.h | 70 ++++++++ .../filters/network/well_known_names.h | 2 + test/config/utility.cc | 12 ++ test/config/utility.h | 3 + .../network/sni_dynamic_forward_proxy/BUILD | 46 ++++++ .../proxy_filter_integration_test.cc | 154 ++++++++++++++++++ .../proxy_filter_test.cc | 107 ++++++++++++ test/integration/fake_upstream.cc | 4 +- test/integration/ssl_utility.cc | 3 + test/integration/ssl_utility.h | 6 + 28 files changed, 796 insertions(+), 4 deletions(-) create mode 100644 api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD create mode 100644 api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto create mode 100644 api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD create mode 100644 api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto create mode 100644 generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD create mode 100644 generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto create mode 100644 generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD create mode 100644 generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto create mode 100644 source/extensions/filters/network/sni_dynamic_forward_proxy/BUILD create mode 100644 source/extensions/filters/network/sni_dynamic_forward_proxy/config.cc create mode 100644 source/extensions/filters/network/sni_dynamic_forward_proxy/config.h create mode 100644 source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc create mode 100644 source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h create mode 100644 test/extensions/filters/network/sni_dynamic_forward_proxy/BUILD create mode 100644 test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc create mode 100644 test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc diff --git a/CODEOWNERS b/CODEOWNERS index 3580d19b7843..e160ee9fabfa 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -32,6 +32,8 @@ extensions/filters/common/original_src @snowp @klarose /*/extensions/transport_sockets/tls @PiotrSikora @lizan # sni_cluster extension /*/extensions/filters/network/sni_cluster @rshriram @lizan +# sni_dynamic_forward_proxy extension +/*/extensions/filters/network/sni_dynamic_forward_proxy @rshriram @lizan # tracers.datadog extension /*/extensions/tracers/datadog @cgilmour @palazzem @mattklein123 # tracers.xray extension diff --git a/api/BUILD b/api/BUILD index c8d845c6455c..c236d0921331 100644 --- a/api/BUILD +++ b/api/BUILD @@ -76,6 +76,7 @@ proto_library( "//envoy/config/filter/network/rbac/v2:pkg", "//envoy/config/filter/network/redis_proxy/v2:pkg", "//envoy/config/filter/network/sni_cluster/v2:pkg", + "//envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha:pkg", "//envoy/config/filter/network/tcp_proxy/v2:pkg", "//envoy/config/filter/network/thrift_proxy/v2alpha1:pkg", "//envoy/config/filter/network/zookeeper_proxy/v1alpha1:pkg", @@ -210,6 +211,7 @@ proto_library( "//envoy/extensions/filters/network/rbac/v3:pkg", "//envoy/extensions/filters/network/redis_proxy/v3:pkg", "//envoy/extensions/filters/network/sni_cluster/v3:pkg", + "//envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha:pkg", "//envoy/extensions/filters/network/tcp_proxy/v3:pkg", "//envoy/extensions/filters/network/thrift_proxy/filters/ratelimit/v3:pkg", "//envoy/extensions/filters/network/thrift_proxy/v3:pkg", diff --git a/api/docs/BUILD b/api/docs/BUILD index 1a791f147502..1da9085d2ec9 100644 --- a/api/docs/BUILD +++ b/api/docs/BUILD @@ -82,6 +82,7 @@ proto_library( "//envoy/config/filter/network/rbac/v2:pkg", "//envoy/config/filter/network/redis_proxy/v2:pkg", "//envoy/config/filter/network/sni_cluster/v2:pkg", + "//envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha:pkg", "//envoy/config/filter/network/tcp_proxy/v2:pkg", "//envoy/config/filter/network/thrift_proxy/v2alpha1:pkg", "//envoy/config/filter/network/zookeeper_proxy/v1alpha1:pkg", diff --git a/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD b/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD new file mode 100644 index 000000000000..3068bcca824e --- /dev/null +++ b/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/config/common/dynamic_forward_proxy/v2alpha:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto b/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto new file mode 100644 index 000000000000..85df2bcd1164 --- /dev/null +++ b/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha; + +import "envoy/config/common/dynamic_forward_proxy/v2alpha/dns_cache.proto"; + +import "udpa/annotations/migrate.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha"; +option java_outer_classname = "SniDynamicForwardProxyProto"; +option java_multiple_files = true; +option (udpa.annotations.file_migrate).move_to_package = + "envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha"; + +// [#protodoc-title: SNI dynamic forward proxy] + +// Configuration for the SNI-based dynamic forward proxy filter. See the +// :ref:`architecture overview ` for +// more information. Note this filter must be configured along with +// :ref:`TLS inspector listener filter ` to work. +// [#extension: envoy.filters.network.sni_dynamic_forward_proxy] +message FilterConfig { + // The DNS cache configuration that the filter will attach to. Note this + // configuration must match that of associated :ref:`dynamic forward proxy + // cluster configuration + // `. + common.dynamic_forward_proxy.v2alpha.DnsCacheConfig dns_cache_config = 1 + [(validate.rules).message = {required: true}]; + + // The port number to connect to the upstream. + uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; +} diff --git a/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD b/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD new file mode 100644 index 000000000000..c5c4bfd6e0f3 --- /dev/null +++ b/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD @@ -0,0 +1,13 @@ +# DO NOT EDIT. This file is generated by tools/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha:pkg", + "//envoy/extensions/common/dynamic_forward_proxy/v3:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto b/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto new file mode 100644 index 000000000000..e4f02cc2899d --- /dev/null +++ b/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha; + +import "envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto"; + +import "udpa/annotations/versioning.proto"; + +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha"; +option java_outer_classname = "SniDynamicForwardProxyProto"; +option java_multiple_files = true; + +// [#protodoc-title: SNI dynamic forward proxy] + +// Configuration for the SNI-based dynamic forward proxy filter. See the +// :ref:`architecture overview ` for +// more information. Note this filter must be configured along with +// :ref:`TLS inspector listener filter ` to work. +// [#extension: envoy.filters.network.sni_dynamic_forward_proxy] +message FilterConfig { + option (udpa.annotations.versioning).previous_message_type = + "envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha.FilterConfig"; + + // The DNS cache configuration that the filter will attach to. Note this + // configuration must match that of associated :ref:`dynamic forward proxy + // cluster configuration + // `. + common.dynamic_forward_proxy.v3.DnsCacheConfig dns_cache_config = 1 + [(validate.rules).message = {required: true}]; + + // The port number to connect to the upstream. + uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; +} diff --git a/docs/root/intro/version_history.rst b/docs/root/intro/version_history.rst index ca0b4ce40a91..c798efb5083f 100644 --- a/docs/root/intro/version_history.rst +++ b/docs/root/intro/version_history.rst @@ -17,6 +17,7 @@ Version history * datasource: added retry policy for remote async data source. * dns: the STRICT_DNS cluster now only resolves to 0 hosts if DNS resolution successfully returns 0 hosts. * dns: added support for :ref:`dns_failure_refresh_rate ` for the :ref:`dns cache ` to set the DNS refresh rate during failures. +* dynamic forward proxy: added SNI based :ref:`dynamic forward proxy ` support. * http filters: http filter extensions use the "envoy.filters.http" name space. A mapping of extension names is available in the :ref:`deprecated ` documentation. * ext_authz: disabled the use of lowercase string matcher for headers matching in HTTP-based `ext_authz`. diff --git a/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD b/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD new file mode 100644 index 000000000000..3068bcca824e --- /dev/null +++ b/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/config/common/dynamic_forward_proxy/v2alpha:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto b/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto new file mode 100644 index 000000000000..85df2bcd1164 --- /dev/null +++ b/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha; + +import "envoy/config/common/dynamic_forward_proxy/v2alpha/dns_cache.proto"; + +import "udpa/annotations/migrate.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha"; +option java_outer_classname = "SniDynamicForwardProxyProto"; +option java_multiple_files = true; +option (udpa.annotations.file_migrate).move_to_package = + "envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha"; + +// [#protodoc-title: SNI dynamic forward proxy] + +// Configuration for the SNI-based dynamic forward proxy filter. See the +// :ref:`architecture overview ` for +// more information. Note this filter must be configured along with +// :ref:`TLS inspector listener filter ` to work. +// [#extension: envoy.filters.network.sni_dynamic_forward_proxy] +message FilterConfig { + // The DNS cache configuration that the filter will attach to. Note this + // configuration must match that of associated :ref:`dynamic forward proxy + // cluster configuration + // `. + common.dynamic_forward_proxy.v2alpha.DnsCacheConfig dns_cache_config = 1 + [(validate.rules).message = {required: true}]; + + // The port number to connect to the upstream. + uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; +} diff --git a/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD b/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD new file mode 100644 index 000000000000..c5c4bfd6e0f3 --- /dev/null +++ b/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD @@ -0,0 +1,13 @@ +# DO NOT EDIT. This file is generated by tools/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha:pkg", + "//envoy/extensions/common/dynamic_forward_proxy/v3:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto b/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto new file mode 100644 index 000000000000..e4f02cc2899d --- /dev/null +++ b/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha; + +import "envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto"; + +import "udpa/annotations/versioning.proto"; + +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha"; +option java_outer_classname = "SniDynamicForwardProxyProto"; +option java_multiple_files = true; + +// [#protodoc-title: SNI dynamic forward proxy] + +// Configuration for the SNI-based dynamic forward proxy filter. See the +// :ref:`architecture overview ` for +// more information. Note this filter must be configured along with +// :ref:`TLS inspector listener filter ` to work. +// [#extension: envoy.filters.network.sni_dynamic_forward_proxy] +message FilterConfig { + option (udpa.annotations.versioning).previous_message_type = + "envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha.FilterConfig"; + + // The DNS cache configuration that the filter will attach to. Note this + // configuration must match that of associated :ref:`dynamic forward proxy + // cluster configuration + // `. + common.dynamic_forward_proxy.v3.DnsCacheConfig dns_cache_config = 1 + [(validate.rules).message = {required: true}]; + + // The port number to connect to the upstream. + uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; +} diff --git a/source/extensions/clusters/dynamic_forward_proxy/cluster.cc b/source/extensions/clusters/dynamic_forward_proxy/cluster.cc index 657bb45753a6..c671aeb3c795 100644 --- a/source/extensions/clusters/dynamic_forward_proxy/cluster.cc +++ b/source/extensions/clusters/dynamic_forward_proxy/cluster.cc @@ -165,12 +165,22 @@ void Cluster::onDnsHostRemove(const std::string& host) { Upstream::HostConstSharedPtr Cluster::LoadBalancer::chooseHost(Upstream::LoadBalancerContext* context) { - if (!context || !context->downstreamHeaders()) { + if (!context) { return nullptr; } - const auto host_it = - host_map_->find(context->downstreamHeaders()->Host()->value().getStringView()); + absl::string_view host; + if (context->downstreamHeaders()) { + host = context->downstreamHeaders()->Host()->value().getStringView(); + } else if (context->downstreamConnection()) { + host = context->downstreamConnection()->requestedServerName(); + } + + if (host.empty()) { + return nullptr; + } + + const auto host_it = host_map_->find(host); if (host_it == host_map_->end()) { return nullptr; } else { diff --git a/source/extensions/extensions_build_config.bzl b/source/extensions/extensions_build_config.bzl index 3c85a8a61a6a..3a2a44a12d8a 100644 --- a/source/extensions/extensions_build_config.bzl +++ b/source/extensions/extensions_build_config.bzl @@ -98,6 +98,7 @@ EXTENSIONS = { "envoy.filters.network.tcp_proxy": "//source/extensions/filters/network/tcp_proxy:config", "envoy.filters.network.thrift_proxy": "//source/extensions/filters/network/thrift_proxy:config", "envoy.filters.network.sni_cluster": "//source/extensions/filters/network/sni_cluster:config", + "envoy.filters.network.sni_dynamic_forward_proxy": "//source/extensions/filters/network/sni_dynamic_forward_proxy:config", "envoy.filters.network.zookeeper_proxy": "//source/extensions/filters/network/zookeeper_proxy:config", # diff --git a/source/extensions/filters/network/sni_dynamic_forward_proxy/BUILD b/source/extensions/filters/network/sni_dynamic_forward_proxy/BUILD new file mode 100644 index 000000000000..6f99807eed1b --- /dev/null +++ b/source/extensions/filters/network/sni_dynamic_forward_proxy/BUILD @@ -0,0 +1,39 @@ +licenses(["notice"]) # Apache 2 + +load( + "//bazel:envoy_build_system.bzl", + "envoy_cc_extension", + "envoy_cc_library", + "envoy_package", +) + +envoy_package() + +envoy_cc_library( + name = "proxy_filter", + srcs = ["proxy_filter.cc"], + hdrs = ["proxy_filter.h"], + deps = [ + "//include/envoy/network:connection_interface", + "//include/envoy/network:filter_interface", + "//source/common/common:assert_lib", + "//source/common/common:minimal_logger_lib", + "//source/common/tcp_proxy", + "//source/extensions/common/dynamic_forward_proxy:dns_cache_interface", + "@envoy_api//envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha:pkg_cc_proto", + ], +) + +envoy_cc_extension( + name = "config", + srcs = ["config.cc"], + hdrs = ["config.h"], + security_posture = "unknown", + deps = [ + ":proxy_filter", + "//source/extensions/common/dynamic_forward_proxy:dns_cache_manager_impl", + "//source/extensions/filters/network:well_known_names", + "//source/extensions/filters/network/common:factory_base_lib", + "@envoy_api//envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha:pkg_cc_proto", + ], +) diff --git a/source/extensions/filters/network/sni_dynamic_forward_proxy/config.cc b/source/extensions/filters/network/sni_dynamic_forward_proxy/config.cc new file mode 100644 index 000000000000..a5f9fa9e1819 --- /dev/null +++ b/source/extensions/filters/network/sni_dynamic_forward_proxy/config.cc @@ -0,0 +1,41 @@ +#include "extensions/filters/network/sni_dynamic_forward_proxy/config.h" + +#include "envoy/registry/registry.h" +#include "envoy/server/filter_config.h" + +#include "extensions/common/dynamic_forward_proxy/dns_cache_manager_impl.h" +#include "extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h" + +namespace Envoy { +namespace Extensions { +namespace NetworkFilters { +namespace SniDynamicForwardProxy { + +SniDynamicForwardProxyNetworkFilterConfigFactory::SniDynamicForwardProxyNetworkFilterConfigFactory() + : FactoryBase(NetworkFilterNames::get().SniDynamicForwardProxy) {} + +Network::FilterFactoryCb +SniDynamicForwardProxyNetworkFilterConfigFactory::createFilterFactoryFromProtoTyped( + const FilterConfig& proto_config, Server::Configuration::FactoryContext& context) { + + Extensions::Common::DynamicForwardProxy::DnsCacheManagerFactoryImpl cache_manager_factory( + context.singletonManager(), context.dispatcher(), context.threadLocal(), context.random(), + context.scope()); + ProxyFilterConfigSharedPtr filter_config(std::make_shared( + proto_config, cache_manager_factory, context.clusterManager())); + + return [filter_config](Network::FilterManager& filter_manager) -> void { + filter_manager.addReadFilter(std::make_shared(filter_config)); + }; +} + +/** + * Static registration for the sni_dynamic_forward_proxy filter. @see RegisterFactory. + */ +REGISTER_FACTORY(SniDynamicForwardProxyNetworkFilterConfigFactory, + Server::Configuration::NamedNetworkFilterConfigFactory); + +} // namespace SniDynamicForwardProxy +} // namespace NetworkFilters +} // namespace Extensions +} // namespace Envoy diff --git a/source/extensions/filters/network/sni_dynamic_forward_proxy/config.h b/source/extensions/filters/network/sni_dynamic_forward_proxy/config.h new file mode 100644 index 000000000000..1f1d6a1d7b03 --- /dev/null +++ b/source/extensions/filters/network/sni_dynamic_forward_proxy/config.h @@ -0,0 +1,32 @@ +#pragma once + +#include "envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.pb.h" +#include "envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.pb.validate.h" + +#include "extensions/filters/network/common/factory_base.h" +#include "extensions/filters/network/well_known_names.h" + +namespace Envoy { +namespace Extensions { +namespace NetworkFilters { +namespace SniDynamicForwardProxy { + +using FilterConfig = + envoy::extensions::filters::network::sni_dynamic_forward_proxy::v3alpha::FilterConfig; + +/** + * Config registration for the sni_dynamic_forward_proxy filter. @see + * NamedNetworkFilterConfigFactory. + */ +class SniDynamicForwardProxyNetworkFilterConfigFactory : public Common::FactoryBase { +public: + SniDynamicForwardProxyNetworkFilterConfigFactory(); + Network::FilterFactoryCb + createFilterFactoryFromProtoTyped(const FilterConfig& proto_config, + Server::Configuration::FactoryContext& context) override; +}; + +} // namespace SniDynamicForwardProxy +} // namespace NetworkFilters +} // namespace Extensions +} // namespace Envoy diff --git a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc new file mode 100644 index 000000000000..6f1b0685afaa --- /dev/null +++ b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc @@ -0,0 +1,72 @@ +#include "extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h" + +#include "envoy/network/connection.h" +#include "envoy/network/filter.h" +#include "envoy/upstream/thread_local_cluster.h" + +#include "common/common/assert.h" +#include "common/tcp_proxy/tcp_proxy.h" + +namespace Envoy { +namespace Extensions { +namespace NetworkFilters { +namespace SniDynamicForwardProxy { + +ProxyFilterConfig::ProxyFilterConfig( + const FilterConfig& proto_config, + Extensions::Common::DynamicForwardProxy::DnsCacheManagerFactory& cache_manager_factory, + Upstream::ClusterManager& cluster_manager) + : port_(proto_config.port_value()), dns_cache_manager_(cache_manager_factory.get()), + dns_cache_(dns_cache_manager_->getCache(proto_config.dns_cache_config())), + cluster_manager_(cluster_manager) {} + +ProxyFilter::ProxyFilter(ProxyFilterConfigSharedPtr config) : config_(std::move(config)) {} + +using LoadDnsCacheEntryStatus = Common::DynamicForwardProxy::DnsCache::LoadDnsCacheEntryStatus; + +Network::FilterStatus ProxyFilter::onNewConnection() { + absl::string_view sni = read_callbacks_->connection().requestedServerName(); + ENVOY_CONN_LOG(trace, "sni_dynamic_forward_proxy: new connection with server name '{}'", + read_callbacks_->connection(), sni); + + if (sni.empty()) { + return Network::FilterStatus::Continue; + } + + uint16_t default_port = config_->port(); + + auto result = config_->cache().loadDnsCacheEntry(sni, default_port, *this); + + cache_load_handle_ = std::move(result.handle_); + switch (result.status_) { + case LoadDnsCacheEntryStatus::InCache: { + ASSERT(cache_load_handle_ == nullptr); + ENVOY_CONN_LOG(debug, "DNS cache entry already loaded, continuing", + read_callbacks_->connection()); + return Network::FilterStatus::Continue; + } + case LoadDnsCacheEntryStatus::Loading: { + ASSERT(cache_load_handle_ != nullptr); + ENVOY_CONN_LOG(debug, "waiting to load DNS cache entry", read_callbacks_->connection()); + return Network::FilterStatus::StopIteration; + } + case LoadDnsCacheEntryStatus::Overflow: { + ASSERT(cache_load_handle_ == nullptr); + ENVOY_CONN_LOG(debug, "DNS cache overflow", read_callbacks_->connection()); + read_callbacks_->connection().close(Network::ConnectionCloseType::NoFlush); + return Network::FilterStatus::StopIteration; + } + } + + NOT_REACHED_GCOVR_EXCL_LINE; +} + +void ProxyFilter::onLoadDnsCacheComplete() { + ENVOY_CONN_LOG(debug, "load DNS cache complete, continuing", read_callbacks_->connection()); + read_callbacks_->continueReading(); +} + +} // namespace SniDynamicForwardProxy +} // namespace NetworkFilters +} // namespace Extensions +} // namespace Envoy diff --git a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h new file mode 100644 index 000000000000..d20134312b47 --- /dev/null +++ b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h @@ -0,0 +1,70 @@ +#pragma once + +#include "envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.pb.h" +#include "envoy/network/filter.h" +#include "envoy/upstream/cluster_manager.h" + +#include "common/common/logger.h" + +#include "extensions/common/dynamic_forward_proxy/dns_cache.h" + +namespace Envoy { +namespace Extensions { +namespace NetworkFilters { +namespace SniDynamicForwardProxy { + +using FilterConfig = + envoy::extensions::filters::network::sni_dynamic_forward_proxy::v3alpha::FilterConfig; + +class ProxyFilterConfig { +public: + ProxyFilterConfig( + const FilterConfig& proto_config, + Extensions::Common::DynamicForwardProxy::DnsCacheManagerFactory& cache_manager_factory, + Upstream::ClusterManager& cluster_manager); + + Extensions::Common::DynamicForwardProxy::DnsCache& cache() { return *dns_cache_; } + Upstream::ClusterManager& clusterManager() { return cluster_manager_; } + uint32_t port() { return port_; } + +private: + const uint32_t port_; + const Extensions::Common::DynamicForwardProxy::DnsCacheManagerSharedPtr dns_cache_manager_; + const Extensions::Common::DynamicForwardProxy::DnsCacheSharedPtr dns_cache_; + Upstream::ClusterManager& cluster_manager_; +}; + +using ProxyFilterConfigSharedPtr = std::shared_ptr; + +/** + * Implementation of the sni_cluster filter that sets the upstream cluster name from + * the SNI field in the TLS connection. + */ +class ProxyFilter + : public Network::ReadFilter, + public Extensions::Common::DynamicForwardProxy::DnsCache::LoadDnsCacheEntryCallbacks, + Logger::Loggable { +public: + ProxyFilter(ProxyFilterConfigSharedPtr config); + // Network::ReadFilter + Network::FilterStatus onData(Buffer::Instance&, bool) override { + return Network::FilterStatus::Continue; + } + Network::FilterStatus onNewConnection() override; + void initializeReadFilterCallbacks(Network::ReadFilterCallbacks& callbacks) override { + read_callbacks_ = &callbacks; + } + + // Extensions::Common::DynamicForwardProxy::DnsCache::LoadDnsCacheEntryCallbacks + void onLoadDnsCacheComplete() override; + +private: + ProxyFilterConfigSharedPtr config_; + Extensions::Common::DynamicForwardProxy::DnsCache::LoadDnsCacheEntryHandlePtr cache_load_handle_; + Network::ReadFilterCallbacks* read_callbacks_{}; +}; + +} // namespace SniDynamicForwardProxy +} // namespace NetworkFilters +} // namespace Extensions +} // namespace Envoy diff --git a/source/extensions/filters/network/well_known_names.h b/source/extensions/filters/network/well_known_names.h index 5373f757fd88..9a9b0e59d74a 100644 --- a/source/extensions/filters/network/well_known_names.h +++ b/source/extensions/filters/network/well_known_names.h @@ -44,6 +44,8 @@ class NetworkFilterNameValues { const std::string Rbac = "envoy.filters.network.rbac"; // SNI Cluster filter const std::string SniCluster = "envoy.filters.network.sni_cluster"; + // SNI Dynamic forward proxy filter + const std::string SniDynamicForwardProxy = "envoy.filters.network.sni_dynamic_forward_proxy"; // ZooKeeper proxy filter const std::string ZooKeeperProxy = "envoy.filters.network.zookeeper_proxy"; }; diff --git a/test/config/utility.cc b/test/config/utility.cc index 10d024933651..7f3d8a5b478d 100644 --- a/test/config/utility.cc +++ b/test/config/utility.cc @@ -759,6 +759,18 @@ envoy::config::listener::v3::Filter* ConfigHelper::getFilterFromListener(const s return nullptr; } +void ConfigHelper::addListenerFilter(const std::string& filter_yaml) { + RELEASE_ASSERT(!finalized_, ""); + auto* listener = bootstrap_.mutable_static_resources()->mutable_listeners(0); + auto* filter_list_back = listener->add_listener_filters(); + TestUtility::loadFromYaml(filter_yaml, *filter_list_back); + + // Now move it to the front. + for (int i = listener->listener_filters_size() - 1; i > 0; --i) { + listener->mutable_listener_filters()->SwapElements(i, i - 1); + } +} + void ConfigHelper::addNetworkFilter(const std::string& filter_yaml) { RELEASE_ASSERT(!finalized_, ""); auto* filter_chain = diff --git a/test/config/utility.h b/test/config/utility.h index e47601919866..c59534cdb70e 100644 --- a/test/config/utility.h +++ b/test/config/utility.h @@ -137,6 +137,9 @@ class ConfigHelper { // Add a network filter prior to existing filters. void addNetworkFilter(const std::string& filter_yaml); + // Add a listener filter prior to existing listener filters. + void addListenerFilter(const std::string& filter_yaml); + // Sets the client codec to the specified type. void setClientCodec(envoy::extensions::filters::network::http_connection_manager::v3:: HttpConnectionManager::CodecType type); diff --git a/test/extensions/filters/network/sni_dynamic_forward_proxy/BUILD b/test/extensions/filters/network/sni_dynamic_forward_proxy/BUILD new file mode 100644 index 000000000000..a931923403d2 --- /dev/null +++ b/test/extensions/filters/network/sni_dynamic_forward_proxy/BUILD @@ -0,0 +1,46 @@ +licenses(["notice"]) # Apache 2 + +load( + "//bazel:envoy_build_system.bzl", + "envoy_package", +) +load( + "//test/extensions:extensions_build_system.bzl", + "envoy_extension_cc_test", +) + +envoy_package() + +envoy_extension_cc_test( + name = "proxy_filter_test", + srcs = ["proxy_filter_test.cc"], + extension_name = "envoy.filters.network.sni_dynamic_forward_proxy", + deps = [ + "//source/extensions/filters/network:well_known_names", + "//source/extensions/filters/network/sni_dynamic_forward_proxy:config", + "//test/extensions/common/dynamic_forward_proxy:mocks", + "//test/mocks/http:http_mocks", + "//test/mocks/upstream:upstream_mocks", + "@envoy_api//envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha:pkg_cc_proto", + ], +) + +envoy_extension_cc_test( + name = "proxy_filter_integration_test", + srcs = ["proxy_filter_integration_test.cc"], + data = [ + "//test/config/integration/certs", + ], + extension_name = "envoy.filters.network.sni_dynamic_forward_proxy", + deps = [ + "//source/extensions/clusters/dynamic_forward_proxy:cluster", + "//source/extensions/filters/listener/tls_inspector:config", + "//source/extensions/filters/network/sni_dynamic_forward_proxy:config", + "//source/extensions/filters/network/tcp_proxy:config", + "//test/integration:http_integration_lib", + "@envoy_api//envoy/config/bootstrap/v3:pkg_cc_proto", + "@envoy_api//envoy/config/cluster/v3:pkg_cc_proto", + "@envoy_api//envoy/extensions/filters/network/http_connection_manager/v3:pkg_cc_proto", + "@envoy_api//envoy/extensions/transport_sockets/tls/v3:pkg_cc_proto", + ], +) diff --git a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc new file mode 100644 index 000000000000..b87a4564e7af --- /dev/null +++ b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc @@ -0,0 +1,154 @@ +#include "envoy/config/bootstrap/v3/bootstrap.pb.h" +#include "envoy/config/cluster/v3/cluster.pb.h" +#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.h" +#include "envoy/extensions/transport_sockets/tls/v3/cert.pb.h" + +#include "extensions/transport_sockets/tls/context_config_impl.h" +#include "extensions/transport_sockets/tls/ssl_socket.h" + +#include "test/integration/http_integration.h" +#include "test/integration/ssl_utility.h" + +namespace Envoy { +namespace { + +class ProxyFilterIntegrationTest : public testing::TestWithParam, + public Event::TestUsingSimulatedTime, + public HttpIntegrationTest { +public: + ProxyFilterIntegrationTest() + : HttpIntegrationTest(Http::CodecClient::Type::HTTP1, GetParam(), + ConfigHelper::TCP_PROXY_CONFIG) {} + + static std::string ipVersionToDnsFamily(Network::Address::IpVersion version) { + switch (version) { + case Network::Address::IpVersion::v4: + return "V4_ONLY"; + case Network::Address::IpVersion::v6: + return "V6_ONLY"; + } + + // This seems to be needed on the coverage build for some reason. + NOT_REACHED_GCOVR_EXCL_LINE; + } + + void setup(uint64_t max_hosts = 1024) { + setUpstreamProtocol(FakeHttpConnection::Type::HTTP1); + + config_helper_.addListenerFilter("name: envoy.listener.tls_inspector"); + + config_helper_.addConfigModifier([this, max_hosts]( + envoy::config::bootstrap::v3::Bootstrap& bootstrap) { + // Switch predefined cluster_0 to CDS filesystem sourcing. + bootstrap.mutable_dynamic_resources()->mutable_cds_config()->set_path(cds_helper_.cds_path()); + bootstrap.mutable_static_resources()->clear_clusters(); + + const std::string filter = fmt::format(R"EOF( +name: envoy.filters.http.dynamic_forward_proxy +typed_config: + "@type": type.googleapis.com/envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha.FilterConfig + dns_cache_config: + name: foo + dns_lookup_family: {} + max_hosts: {} + port_value: {} +)EOF", + ipVersionToDnsFamily(GetParam()), max_hosts, + fake_upstreams_[0]->localAddress()->ip()->port()); + config_helper_.addNetworkFilter(filter); + }); + + // Setup the initial CDS cluster. + cluster_.mutable_connect_timeout()->CopyFrom( + Protobuf::util::TimeUtil::MillisecondsToDuration(100)); + cluster_.set_name("cluster_0"); + cluster_.set_lb_policy(envoy::config::cluster::v3::Cluster::CLUSTER_PROVIDED); + + const std::string cluster_type_config = + fmt::format(R"EOF( +name: envoy.clusters.dynamic_forward_proxy +typed_config: + "@type": type.googleapis.com/envoy.config.cluster.dynamic_forward_proxy.v2alpha.ClusterConfig + dns_cache_config: + name: foo + dns_lookup_family: {} + max_hosts: {} +)EOF", + ipVersionToDnsFamily(GetParam()), max_hosts); + + TestUtility::loadFromYaml(cluster_type_config, *cluster_.mutable_cluster_type()); + + // Load the CDS cluster and wait for it to initialize. + cds_helper_.setCds({cluster_}); + HttpIntegrationTest::initialize(); + test_server_->waitForCounterEq("cluster_manager.cluster_added", 1); + test_server_->waitForGaugeEq("cluster_manager.warming_clusters", 0); + } + + void createUpstreams() override { + fake_upstreams_.emplace_back(new FakeUpstream( + createUpstreamSslContext(), 0, FakeHttpConnection::Type::HTTP1, version_, timeSystem())); + } + + // TODO(mattklein123): This logic is duplicated in various places. Cleanup in a follow up. + Network::TransportSocketFactoryPtr createUpstreamSslContext() { + envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context; + auto* common_tls_context = tls_context.mutable_common_tls_context(); + auto* tls_cert = common_tls_context->add_tls_certificates(); + tls_cert->mutable_certificate_chain()->set_filename(TestEnvironment::runfilesPath( + fmt::format("test/config/integration/certs/{}cert.pem", upstream_cert_name_))); + tls_cert->mutable_private_key()->set_filename(TestEnvironment::runfilesPath( + fmt::format("test/config/integration/certs/{}key.pem", upstream_cert_name_))); + + auto cfg = std::make_unique( + tls_context, factory_context_); + + static Stats::Scope* upstream_stats_store = new Stats::IsolatedStoreImpl(); + return std::make_unique( + std::move(cfg), context_manager_, *upstream_stats_store, std::vector{}); + } + + Network::ClientConnectionPtr + makeSslClientConnection(const Ssl::ClientSslTransportOptions& options) { + + Network::Address::InstanceConstSharedPtr address = + Ssl::getSslAddress(version_, lookupPort("http")); + auto client_transport_socket_factory_ptr = + Ssl::createClientSslTransportSocketFactory(options, context_manager_, *api_); + return dispatcher_->createClientConnection( + address, Network::Address::InstanceConstSharedPtr(), + client_transport_socket_factory_ptr->createTransportSocket({}), nullptr); + } + + std::string upstream_cert_name_{"server"}; + CdsHelper cds_helper_; + envoy::config::cluster::v3::Cluster cluster_; +}; + +INSTANTIATE_TEST_SUITE_P(IpVersions, ProxyFilterIntegrationTest, + testing::ValuesIn(TestEnvironment::getIpVersionsForTest()), + TestUtility::ipTestParamsToString); + +// Verify that upstream TLS works with auto verification for SAN as well as auto setting SNI. +TEST_P(ProxyFilterIntegrationTest, UpstreamTls) { + setup(); + fake_upstreams_[0]->setReadDisableOnNewConnection(false); + + codec_client_ = makeHttpConnection( + makeSslClientConnection(Ssl::ClientSslTransportOptions().setSni("localhost"))); + const Http::TestRequestHeaderMapImpl request_headers{ + {":method", "POST"}, + {":path", "/test/long/url"}, + {":scheme", "http"}, + {":authority", + fmt::format("localhost:{}", fake_upstreams_[0]->localAddress()->ip()->port())}}; + + auto response = codec_client_->makeHeaderOnlyRequest(request_headers); + waitForNextUpstreamRequest(); + + upstream_request_->encodeHeaders(default_response_headers_, true); + response->waitForEndStream(); + checkSimpleRequestSuccess(0, 0, response.get()); +} +} // namespace +} // namespace Envoy diff --git a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc new file mode 100644 index 000000000000..17a11b6697a9 --- /dev/null +++ b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc @@ -0,0 +1,107 @@ +#include "envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.pb.h" +#include "envoy/network/connection.h" + +#include "extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h" +#include "extensions/filters/network/well_known_names.h" + +#include "test/extensions/common/dynamic_forward_proxy/mocks.h" +#include "test/mocks/http/mocks.h" +#include "test/mocks/upstream/mocks.h" +#include "test/mocks/upstream/transport_socket_match.h" + +using testing::AtLeast; +using testing::Eq; +using testing::InSequence; +using testing::Return; +using testing::ReturnRef; + +namespace Envoy { +namespace Extensions { +namespace NetworkFilters { +namespace SniDynamicForwardProxy { +namespace { + +using LoadDnsCacheEntryStatus = Common::DynamicForwardProxy::DnsCache::LoadDnsCacheEntryStatus; +using MockLoadDnsCacheEntryResult = + Common::DynamicForwardProxy::MockDnsCache::MockLoadDnsCacheEntryResult; + +class ProxyFilterTest : public testing::Test, + public Extensions::Common::DynamicForwardProxy::DnsCacheManagerFactory { +public: + ProxyFilterTest() { + FilterConfig proto_config; + proto_config.set_port_value(443); + EXPECT_CALL(*dns_cache_manager_, getCache(_)); + filter_config_ = std::make_shared(proto_config, *this, cm_); + filter_ = std::make_unique(filter_config_); + filter_->initializeReadFilterCallbacks(callbacks_); + + // Allow for an otherwise strict mock. + ON_CALL(callbacks_, connection()).WillByDefault(ReturnRef(connection_)); + EXPECT_CALL(callbacks_, connection()).Times(AtLeast(0)); + + // Configure max pending to 1 so we can test circuit breaking. + cm_.thread_local_cluster_.cluster_.info_->resetResourceManager(0, 1, 0, 0, 0); + } + + ~ProxyFilterTest() override { + EXPECT_TRUE( + cm_.thread_local_cluster_.cluster_.info_->resource_manager_->pendingRequests().canCreate()); + } + + Extensions::Common::DynamicForwardProxy::DnsCacheManagerSharedPtr get() override { + return dns_cache_manager_; + } + + std::shared_ptr dns_cache_manager_{ + new Extensions::Common::DynamicForwardProxy::MockDnsCacheManager()}; + Upstream::MockClusterManager cm_; + ProxyFilterConfigSharedPtr filter_config_; + std::unique_ptr filter_; + Network::MockReadFilterCallbacks callbacks_; + Network::MockConnection connection_; +}; + +// No SNI handling. +TEST_F(ProxyFilterTest, NoSNI) { + EXPECT_CALL(connection_, requestedServerName()).WillRepeatedly(Return("")); + EXPECT_EQ(Network::FilterStatus::Continue, filter_->onNewConnection()); +} + +TEST_F(ProxyFilterTest, LoadDnsCache) { + EXPECT_CALL(connection_, requestedServerName()).WillRepeatedly(Return("foo")); + Extensions::Common::DynamicForwardProxy::MockLoadDnsCacheEntryHandle* handle = + new Extensions::Common::DynamicForwardProxy::MockLoadDnsCacheEntryHandle(); + EXPECT_CALL(*dns_cache_manager_->dns_cache_, loadDnsCacheEntry_(Eq("foo"), 443, _)) + .WillOnce(Return(MockLoadDnsCacheEntryResult{LoadDnsCacheEntryStatus::Loading, handle})); + EXPECT_EQ(Network::FilterStatus::StopIteration, filter_->onNewConnection()); + + EXPECT_CALL(callbacks_, continueReading()); + filter_->onLoadDnsCacheComplete(); + + EXPECT_CALL(*handle, onDestroy()); +} + +TEST_F(ProxyFilterTest, LoadDnsInCache) { + EXPECT_CALL(connection_, requestedServerName()).WillRepeatedly(Return("foo")); + EXPECT_CALL(*dns_cache_manager_->dns_cache_, loadDnsCacheEntry_(Eq("foo"), 443, _)) + .WillOnce(Return(MockLoadDnsCacheEntryResult{LoadDnsCacheEntryStatus::InCache, nullptr})); + + EXPECT_EQ(Network::FilterStatus::Continue, filter_->onNewConnection()); +} + +// Cache overflow. +TEST_F(ProxyFilterTest, CacheOverflow) { + EXPECT_CALL(connection_, requestedServerName()).WillRepeatedly(Return("foo")); + EXPECT_CALL(*dns_cache_manager_->dns_cache_, loadDnsCacheEntry_(Eq("foo"), 443, _)) + .WillOnce(Return(MockLoadDnsCacheEntryResult{LoadDnsCacheEntryStatus::Overflow, nullptr})); + EXPECT_CALL(connection_, close(Network::ConnectionCloseType::NoFlush)); + EXPECT_EQ(Network::FilterStatus::StopIteration, filter_->onNewConnection()); +} + +} // namespace + +} // namespace SniDynamicForwardProxy +} // namespace NetworkFilters +} // namespace Extensions +} // namespace Envoy diff --git a/test/integration/fake_upstream.cc b/test/integration/fake_upstream.cc index 922f9a2143bb..b192f262de21 100644 --- a/test/integration/fake_upstream.cc +++ b/test/integration/fake_upstream.cc @@ -498,7 +498,9 @@ AssertionResult FakeUpstream::waitForHttpConnection(Event::Dispatcher& client_di max_request_headers_count); } VERIFY_ASSERTION(connection->initialize()); - VERIFY_ASSERTION(connection->readDisable(false)); + if (read_disable_on_new_connection_) { + VERIFY_ASSERTION(connection->readDisable(false)); + } return AssertionSuccess(); } diff --git a/test/integration/ssl_utility.cc b/test/integration/ssl_utility.cc index 7d9b710e16ca..34ad7f6826b3 100644 --- a/test/integration/ssl_utility.cc +++ b/test/integration/ssl_utility.cc @@ -64,6 +64,9 @@ createClientSslTransportSocketFactory(const ClientSslTransportOptions& options, for (const std::string& cipher_suite : options.cipher_suites_) { common_context->mutable_tls_params()->add_cipher_suites(cipher_suite); } + if (!options.sni_.empty()) { + tls_context.set_sni(options.sni_); + } common_context->mutable_tls_params()->set_tls_minimum_protocol_version(options.tls_version_); common_context->mutable_tls_params()->set_tls_maximum_protocol_version(options.tls_version_); diff --git a/test/integration/ssl_utility.h b/test/integration/ssl_utility.h index 8826db3cb4e3..56a0efc81f79 100644 --- a/test/integration/ssl_utility.h +++ b/test/integration/ssl_utility.h @@ -42,11 +42,17 @@ struct ClientSslTransportOptions { return *this; } + ClientSslTransportOptions& setSni(absl::string_view sni) { + sni_ = std::string(sni); + return *this; + } + bool alpn_{}; bool san_{}; bool client_ecdsa_cert_{}; std::vector cipher_suites_{}; std::string sigalgs_; + std::string sni_; envoy::extensions::transport_sockets::tls::v3::TlsParameters::TlsProtocol tls_version_{ envoy::extensions::transport_sockets::tls::v3::TlsParameters::TLS_AUTO}; }; From 201a4cdd6cc74d37d804ad73792e585711a0a2dd Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Thu, 19 Mar 2020 01:12:33 +0000 Subject: [PATCH 02/15] fix docs Signed-off-by: Lizan Zhou --- docs/root/api-v3/config/filter/network/network.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/root/api-v3/config/filter/network/network.rst b/docs/root/api-v3/config/filter/network/network.rst index 4b56226331b6..7db2ad7b427d 100644 --- a/docs/root/api-v3/config/filter/network/network.rst +++ b/docs/root/api-v3/config/filter/network/network.rst @@ -7,3 +7,4 @@ Network filters */empty/* ../../../extensions/filters/network/*/v3/* + ../../../extensions/filters/network/*/v3alpha/* From e22b9db2c4ee90e5592635a9ee16e527c45958df Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Fri, 20 Mar 2020 00:03:22 +0000 Subject: [PATCH 03/15] deflake test Signed-off-by: Lizan Zhou --- .../proxy_filter_integration_test.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc index b87a4564e7af..8b4fd9c26e9a 100644 --- a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc +++ b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc @@ -136,6 +136,10 @@ TEST_P(ProxyFilterIntegrationTest, UpstreamTls) { codec_client_ = makeHttpConnection( makeSslClientConnection(Ssl::ClientSslTransportOptions().setSni("localhost"))); + ASSERT_TRUE(fake_upstreams_[0]->waitForHttpConnection( + *dispatcher_, fake_upstream_connection_, TestUtility::DefaultTimeout, max_request_headers_kb_, + max_request_headers_count_)); + const Http::TestRequestHeaderMapImpl request_headers{ {":method", "POST"}, {":path", "/test/long/url"}, From 50345a9c46e76f66463cc32cc0298682e573e5d7 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Fri, 20 Mar 2020 01:39:43 +0000 Subject: [PATCH 04/15] use new name Signed-off-by: Lizan Zhou --- .../sni_dynamic_forward_proxy/proxy_filter_integration_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc index 8b4fd9c26e9a..b5bc72c2765e 100644 --- a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc +++ b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc @@ -35,7 +35,7 @@ class ProxyFilterIntegrationTest : public testing::TestWithParam Date: Fri, 27 Mar 2020 22:11:14 +0000 Subject: [PATCH 05/15] review Signed-off-by: Lizan Zhou --- .../v2alpha/sni_dynamic_forward_proxy.proto | 9 +++++-- .../v3alpha/sni_dynamic_forward_proxy.proto | 10 +++++--- .../network_filters/network_filters.rst | 1 + docs/root/intro/version_history.rst | 2 +- .../v2alpha/sni_dynamic_forward_proxy.proto | 9 +++++-- .../v3alpha/sni_dynamic_forward_proxy.proto | 10 +++++--- .../network/sni_dynamic_forward_proxy/BUILD | 5 ++-- .../sni_dynamic_forward_proxy/config.h | 2 ++ .../proxy_filter_integration_test.cc | 25 ++++--------------- .../proxy_filter_integration_test.cc | 21 ++-------------- .../proxy_filter_test.cc | 1 + test/integration/ssl_utility.cc | 18 +++++++++++++ test/integration/ssl_utility.h | 5 ++++ 13 files changed, 66 insertions(+), 52 deletions(-) diff --git a/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto b/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto index 85df2bcd1164..709e1a37a3b3 100644 --- a/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto +++ b/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto @@ -5,6 +5,7 @@ package envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha; import "envoy/config/common/dynamic_forward_proxy/v2alpha/dns_cache.proto"; import "udpa/annotations/migrate.proto"; +import "udpa/annotations/status.proto"; import "validate/validate.proto"; option java_package = "io.envoyproxy.envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha"; @@ -12,6 +13,8 @@ option java_outer_classname = "SniDynamicForwardProxyProto"; option java_multiple_files = true; option (udpa.annotations.file_migrate).move_to_package = "envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha"; +option (udpa.annotations.file_status).work_in_progress = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: SNI dynamic forward proxy] @@ -28,6 +31,8 @@ message FilterConfig { common.dynamic_forward_proxy.v2alpha.DnsCacheConfig dns_cache_config = 1 [(validate.rules).message = {required: true}]; - // The port number to connect to the upstream. - uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; + oneof port_specifier { + // The port number to connect to the upstream. + uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; + } } diff --git a/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto b/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto index e4f02cc2899d..29bb2745183e 100644 --- a/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto +++ b/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto @@ -4,13 +4,15 @@ package envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha; import "envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto"; +import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; - import "validate/validate.proto"; option java_package = "io.envoyproxy.envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha"; option java_outer_classname = "SniDynamicForwardProxyProto"; option java_multiple_files = true; +option (udpa.annotations.file_status).work_in_progress = true; +option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE; // [#protodoc-title: SNI dynamic forward proxy] @@ -30,6 +32,8 @@ message FilterConfig { common.dynamic_forward_proxy.v3.DnsCacheConfig dns_cache_config = 1 [(validate.rules).message = {required: true}]; - // The port number to connect to the upstream. - uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; + oneof port_specifier { + // The port number to connect to the upstream. + uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; + } } diff --git a/docs/root/configuration/listeners/network_filters/network_filters.rst b/docs/root/configuration/listeners/network_filters/network_filters.rst index 635c706af6a9..bb4d14911142 100644 --- a/docs/root/configuration/listeners/network_filters/network_filters.rst +++ b/docs/root/configuration/listeners/network_filters/network_filters.rst @@ -25,4 +25,5 @@ filters. tcp_proxy_filter thrift_proxy_filter sni_cluster_filter + sni_dynamic_forward_proxy_filter zookeeper_proxy_filter diff --git a/docs/root/intro/version_history.rst b/docs/root/intro/version_history.rst index 3b388ca25ca9..b0a1314658c2 100644 --- a/docs/root/intro/version_history.rst +++ b/docs/root/intro/version_history.rst @@ -24,7 +24,7 @@ Version history * datasource: added retry policy for remote async data source. * dns: the STRICT_DNS cluster now only resolves to 0 hosts if DNS resolution successfully returns 0 hosts. * dns: added support for :ref:`dns_failure_refresh_rate ` for the :ref:`dns cache ` to set the DNS refresh rate during failures. -* dynamic forward proxy: added SNI based :ref:`dynamic forward proxy ` support. +* dynamic forward proxy: added SNI based :ref:`dynamic forward proxy ` support. * http filters: http filter extensions use the "envoy.filters.http" name space. A mapping of extension names is available in the :ref:`deprecated ` documentation. * ext_authz: disabled the use of lowercase string matcher for headers matching in HTTP-based `ext_authz`. diff --git a/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto b/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto index 85df2bcd1164..709e1a37a3b3 100644 --- a/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto +++ b/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto @@ -5,6 +5,7 @@ package envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha; import "envoy/config/common/dynamic_forward_proxy/v2alpha/dns_cache.proto"; import "udpa/annotations/migrate.proto"; +import "udpa/annotations/status.proto"; import "validate/validate.proto"; option java_package = "io.envoyproxy.envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha"; @@ -12,6 +13,8 @@ option java_outer_classname = "SniDynamicForwardProxyProto"; option java_multiple_files = true; option (udpa.annotations.file_migrate).move_to_package = "envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha"; +option (udpa.annotations.file_status).work_in_progress = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: SNI dynamic forward proxy] @@ -28,6 +31,8 @@ message FilterConfig { common.dynamic_forward_proxy.v2alpha.DnsCacheConfig dns_cache_config = 1 [(validate.rules).message = {required: true}]; - // The port number to connect to the upstream. - uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; + oneof port_specifier { + // The port number to connect to the upstream. + uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; + } } diff --git a/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto b/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto index e4f02cc2899d..29bb2745183e 100644 --- a/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto +++ b/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto @@ -4,13 +4,15 @@ package envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha; import "envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto"; +import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; - import "validate/validate.proto"; option java_package = "io.envoyproxy.envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha"; option java_outer_classname = "SniDynamicForwardProxyProto"; option java_multiple_files = true; +option (udpa.annotations.file_status).work_in_progress = true; +option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE; // [#protodoc-title: SNI dynamic forward proxy] @@ -30,6 +32,8 @@ message FilterConfig { common.dynamic_forward_proxy.v3.DnsCacheConfig dns_cache_config = 1 [(validate.rules).message = {required: true}]; - // The port number to connect to the upstream. - uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; + oneof port_specifier { + // The port number to connect to the upstream. + uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; + } } diff --git a/source/extensions/filters/network/sni_dynamic_forward_proxy/BUILD b/source/extensions/filters/network/sni_dynamic_forward_proxy/BUILD index 6f99807eed1b..b4a08a55260c 100644 --- a/source/extensions/filters/network/sni_dynamic_forward_proxy/BUILD +++ b/source/extensions/filters/network/sni_dynamic_forward_proxy/BUILD @@ -10,7 +10,7 @@ load( envoy_package() envoy_cc_library( - name = "proxy_filter", + name = "proxy_filter_lib", srcs = ["proxy_filter.cc"], hdrs = ["proxy_filter.h"], deps = [ @@ -29,8 +29,9 @@ envoy_cc_extension( srcs = ["config.cc"], hdrs = ["config.h"], security_posture = "unknown", + status = "alpha", deps = [ - ":proxy_filter", + ":proxy_filter_lib", "//source/extensions/common/dynamic_forward_proxy:dns_cache_manager_impl", "//source/extensions/filters/network:well_known_names", "//source/extensions/filters/network/common:factory_base_lib", diff --git a/source/extensions/filters/network/sni_dynamic_forward_proxy/config.h b/source/extensions/filters/network/sni_dynamic_forward_proxy/config.h index 1f1d6a1d7b03..c54dc6d56937 100644 --- a/source/extensions/filters/network/sni_dynamic_forward_proxy/config.h +++ b/source/extensions/filters/network/sni_dynamic_forward_proxy/config.h @@ -21,6 +21,8 @@ using FilterConfig = class SniDynamicForwardProxyNetworkFilterConfigFactory : public Common::FactoryBase { public: SniDynamicForwardProxyNetworkFilterConfigFactory(); + +private: Network::FilterFactoryCb createFilterFactoryFromProtoTyped(const FilterConfig& proto_config, Server::Configuration::FactoryContext& context) override; diff --git a/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc b/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc index aba6b60a649d..a5ede7bf0701 100644 --- a/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc +++ b/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc @@ -7,6 +7,7 @@ #include "extensions/transport_sockets/tls/ssl_socket.h" #include "test/integration/http_integration.h" +#include "test/integration/ssl_utility.h" namespace Envoy { namespace { @@ -94,31 +95,15 @@ name: envoy.clusters.dynamic_forward_proxy void createUpstreams() override { if (upstream_tls_) { - fake_upstreams_.emplace_back(new FakeUpstream( - createUpstreamSslContext(), 0, FakeHttpConnection::Type::HTTP1, version_, timeSystem())); + fake_upstreams_.emplace_back( + new FakeUpstream(Ssl::createFakeUpstreamSslContext(upstream_cert_name_, context_manager_, + factory_context_), + 0, FakeHttpConnection::Type::HTTP1, version_, timeSystem())); } else { HttpIntegrationTest::createUpstreams(); } } - // TODO(mattklein123): This logic is duplicated in various places. Cleanup in a follow up. - Network::TransportSocketFactoryPtr createUpstreamSslContext() { - envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context; - auto* common_tls_context = tls_context.mutable_common_tls_context(); - auto* tls_cert = common_tls_context->add_tls_certificates(); - tls_cert->mutable_certificate_chain()->set_filename(TestEnvironment::runfilesPath( - fmt::format("test/config/integration/certs/{}cert.pem", upstream_cert_name_))); - tls_cert->mutable_private_key()->set_filename(TestEnvironment::runfilesPath( - fmt::format("test/config/integration/certs/{}key.pem", upstream_cert_name_))); - - auto cfg = std::make_unique( - tls_context, factory_context_); - - static Stats::Scope* upstream_stats_store = new Stats::IsolatedStoreImpl(); - return std::make_unique( - std::move(cfg), context_manager_, *upstream_stats_store, std::vector{}); - } - bool upstream_tls_{}; std::string upstream_cert_name_{"upstreamlocalhost"}; CdsHelper cds_helper_; diff --git a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc index b5bc72c2765e..163e19593f6e 100644 --- a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc +++ b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc @@ -87,25 +87,8 @@ name: envoy.clusters.dynamic_forward_proxy void createUpstreams() override { fake_upstreams_.emplace_back(new FakeUpstream( - createUpstreamSslContext(), 0, FakeHttpConnection::Type::HTTP1, version_, timeSystem())); - } - - // TODO(mattklein123): This logic is duplicated in various places. Cleanup in a follow up. - Network::TransportSocketFactoryPtr createUpstreamSslContext() { - envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context; - auto* common_tls_context = tls_context.mutable_common_tls_context(); - auto* tls_cert = common_tls_context->add_tls_certificates(); - tls_cert->mutable_certificate_chain()->set_filename(TestEnvironment::runfilesPath( - fmt::format("test/config/integration/certs/{}cert.pem", upstream_cert_name_))); - tls_cert->mutable_private_key()->set_filename(TestEnvironment::runfilesPath( - fmt::format("test/config/integration/certs/{}key.pem", upstream_cert_name_))); - - auto cfg = std::make_unique( - tls_context, factory_context_); - - static Stats::Scope* upstream_stats_store = new Stats::IsolatedStoreImpl(); - return std::make_unique( - std::move(cfg), context_manager_, *upstream_stats_store, std::vector{}); + Ssl::createFakeUpstreamSslContext(upstream_cert_name_, context_manager_, factory_context_), + 0, FakeHttpConnection::Type::HTTP1, version_, timeSystem())); } Network::ClientConnectionPtr diff --git a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc index 17a11b6697a9..6dc027340c53 100644 --- a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc +++ b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc @@ -41,6 +41,7 @@ class ProxyFilterTest : public testing::Test, EXPECT_CALL(callbacks_, connection()).Times(AtLeast(0)); // Configure max pending to 1 so we can test circuit breaking. + // TODO(lizan): implement circuit breaker in SNI dynamic forward proxy cm_.thread_local_cluster_.cluster_.info_->resetResourceManager(0, 1, 0, 0, 0); } diff --git a/test/integration/ssl_utility.cc b/test/integration/ssl_utility.cc index 34ad7f6826b3..af54c2cdb40a 100644 --- a/test/integration/ssl_utility.cc +++ b/test/integration/ssl_utility.cc @@ -96,6 +96,24 @@ Network::TransportSocketFactoryPtr createUpstreamSslContext(ContextManager& cont std::move(cfg), context_manager, *upstream_stats_store, std::vector{}); } +Network::TransportSocketFactoryPtr createFakeUpstreamSslContext( + const std::string& upstream_cert_name, ContextManager& context_manager, + Server::Configuration::TransportSocketFactoryContext& factory_context) { + envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context; + auto* common_tls_context = tls_context.mutable_common_tls_context(); + auto* tls_cert = common_tls_context->add_tls_certificates(); + tls_cert->mutable_certificate_chain()->set_filename(TestEnvironment::runfilesPath( + fmt::format("test/config/integration/certs/{}cert.pem", upstream_cert_name))); + tls_cert->mutable_private_key()->set_filename(TestEnvironment::runfilesPath( + fmt::format("test/config/integration/certs/{}key.pem", upstream_cert_name))); + + auto cfg = std::make_unique( + tls_context, factory_context); + + static Stats::Scope* upstream_stats_store = new Stats::IsolatedStoreImpl(); + return std::make_unique( + std::move(cfg), context_manager, *upstream_stats_store, std::vector{}); +} Network::Address::InstanceConstSharedPtr getSslAddress(const Network::Address::IpVersion& version, int port) { std::string url = diff --git a/test/integration/ssl_utility.h b/test/integration/ssl_utility.h index 56a0efc81f79..afaf57eae00c 100644 --- a/test/integration/ssl_utility.h +++ b/test/integration/ssl_utility.h @@ -60,9 +60,14 @@ struct ClientSslTransportOptions { Network::TransportSocketFactoryPtr createClientSslTransportSocketFactory(const ClientSslTransportOptions& options, ContextManager& context_manager, Api::Api& api); + Network::TransportSocketFactoryPtr createUpstreamSslContext(ContextManager& context_manager, Api::Api& api); +Network::TransportSocketFactoryPtr +createFakeUpstreamSslContext(const std::string& upstream_cert_name, ContextManager& context_manager, + Server::Configuration::TransportSocketFactoryContext& factory_context); + Network::Address::InstanceConstSharedPtr getSslAddress(const Network::Address::IpVersion& version, int port); From 278f62a24e8d58a2598877c77bd998d71c1b4b74 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Fri, 27 Mar 2020 23:36:53 +0000 Subject: [PATCH 06/15] add doc Signed-off-by: Lizan Zhou --- .../sni_dynamic_forward_proxy_filter.rst | 72 +++++++++++++++++++ docs/root/intro/version_history.rst | 2 +- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 docs/root/configuration/listeners/network_filters/sni_dynamic_forward_proxy_filter.rst diff --git a/docs/root/configuration/listeners/network_filters/sni_dynamic_forward_proxy_filter.rst b/docs/root/configuration/listeners/network_filters/sni_dynamic_forward_proxy_filter.rst new file mode 100644 index 000000000000..43e108d0b601 --- /dev/null +++ b/docs/root/configuration/listeners/network_filters/sni_dynamic_forward_proxy_filter.rst @@ -0,0 +1,72 @@ +.. _config_network_filters_sni_dynamic_forward_proxy: + +SNI dynamic forward proxy +========================= + +.. attention:: + + SNI dynamic forward proxy support should be considered alpha and not production ready. + +Through the combination of :ref:`TLS Inspector ` listener filter, +this netwrok filter and the +:ref:`custom cluster `, +Envoy supports SNI based dynamic forward proxy. The implementation works just like the +:ref:`HTTP dynamic forward proxy `, but using the value in +SNI as target host instead. + +The following is a complete configuration that configures both this filter +as well as the :ref:`dynamic forward proxy cluster +`. Both filter and cluster +must be configured together and point to the same DNS cache parameters for Envoy to operate as an +SNI dynamic forward proxy. + +.. note:: + + The following config doesn't terminate TLS in listener, so there is no need to configure TLS context + in cluster. The TLS handshake is passed through by Envoy. + +.. code-block:: yaml + + admin: + access_log_path: /tmp/admin_access.log + address: + socket_address: + protocol: TCP + address: 127.0.0.1 + port_value: 9901 + static_resources: + listeners: + - name: listener_0 + address: + socket_address: + protocol: TCP + address: 0.0.0.0 + port_value: 10000 + listener_filters: + - name: envoy.filters.listener.tls_inspector + filter_chains: + - filters: + - name: envoy.filters.network.sni_dynamic_forward_proxy + typed_config: + "@type": type.googleapis.com/envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha.FilterConfig + port_value: 443 + dns_cache_config: + name: dynamic_forward_proxy_cache_config + dns_lookup_family: V4_ONLY + - name: envoy.tcp_proxy + typed_config: + "@type": type.googleapis.com/envoy.config.filter.network.tcp_proxy.v2.TcpProxy + stat_prefix: tcp + cluster: dynamic_forward_proxy_cluster + clusters: + - name: dynamic_forward_proxy_cluster + connect_timeout: 1s + lb_policy: CLUSTER_PROVIDED + cluster_type: + name: envoy.clusters.dynamic_forward_proxy + typed_config: + "@type": type.googleapis.com/envoy.config.cluster.dynamic_forward_proxy.v2alpha.ClusterConfig + dns_cache_config: + name: dynamic_forward_proxy_cache_config + dns_lookup_family: V4_ONLY + diff --git a/docs/root/intro/version_history.rst b/docs/root/intro/version_history.rst index b0a1314658c2..6b1467e336f4 100644 --- a/docs/root/intro/version_history.rst +++ b/docs/root/intro/version_history.rst @@ -24,7 +24,7 @@ Version history * datasource: added retry policy for remote async data source. * dns: the STRICT_DNS cluster now only resolves to 0 hosts if DNS resolution successfully returns 0 hosts. * dns: added support for :ref:`dns_failure_refresh_rate ` for the :ref:`dns cache ` to set the DNS refresh rate during failures. -* dynamic forward proxy: added SNI based :ref:`dynamic forward proxy ` support. +* dynamic forward proxy: added :ref:`SNI based dynamic forward proxy ` support. * http filters: http filter extensions use the "envoy.filters.http" name space. A mapping of extension names is available in the :ref:`deprecated ` documentation. * ext_authz: disabled the use of lowercase string matcher for headers matching in HTTP-based `ext_authz`. From 7f3ffd0df811bcf50e52f55fdc6e68d04ccc6018 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Sat, 28 Mar 2020 00:13:05 +0000 Subject: [PATCH 07/15] fix Signed-off-by: Lizan Zhou --- .../network_filters/sni_dynamic_forward_proxy_filter.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/root/configuration/listeners/network_filters/sni_dynamic_forward_proxy_filter.rst b/docs/root/configuration/listeners/network_filters/sni_dynamic_forward_proxy_filter.rst index 43e108d0b601..4751b3a614e5 100644 --- a/docs/root/configuration/listeners/network_filters/sni_dynamic_forward_proxy_filter.rst +++ b/docs/root/configuration/listeners/network_filters/sni_dynamic_forward_proxy_filter.rst @@ -7,9 +7,9 @@ SNI dynamic forward proxy SNI dynamic forward proxy support should be considered alpha and not production ready. -Through the combination of :ref:`TLS Inspector ` listener filter, -this netwrok filter and the -:ref:`custom cluster `, +Through the combination of :ref:`TLS inspector ` listener filter, +this network filter and the +:ref:`dynamic forward proxy cluster `, Envoy supports SNI based dynamic forward proxy. The implementation works just like the :ref:`HTTP dynamic forward proxy `, but using the value in SNI as target host instead. From 6431bba9b2cee554d535134df8fa4d8d911f9445 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Sat, 28 Mar 2020 00:34:02 +0000 Subject: [PATCH 08/15] review Signed-off-by: Lizan Zhou --- .../network/sni_dynamic_forward_proxy/proxy_filter.cc | 3 ++- .../network/sni_dynamic_forward_proxy/proxy_filter.h | 10 +++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc index 6f1b0685afaa..56a37cd9ba06 100644 --- a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc +++ b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc @@ -16,7 +16,8 @@ ProxyFilterConfig::ProxyFilterConfig( const FilterConfig& proto_config, Extensions::Common::DynamicForwardProxy::DnsCacheManagerFactory& cache_manager_factory, Upstream::ClusterManager& cluster_manager) - : port_(proto_config.port_value()), dns_cache_manager_(cache_manager_factory.get()), + : port_(static_cast(proto_config.port_value())), + dns_cache_manager_(cache_manager_factory.get()), dns_cache_(dns_cache_manager_->getCache(proto_config.dns_cache_config())), cluster_manager_(cluster_manager) {} diff --git a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h index d20134312b47..47c42aa4dbba 100644 --- a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h +++ b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h @@ -25,10 +25,10 @@ class ProxyFilterConfig { Extensions::Common::DynamicForwardProxy::DnsCache& cache() { return *dns_cache_; } Upstream::ClusterManager& clusterManager() { return cluster_manager_; } - uint32_t port() { return port_; } + uint16_t port() { return port_; } private: - const uint32_t port_; + const uint16_t port_; const Extensions::Common::DynamicForwardProxy::DnsCacheManagerSharedPtr dns_cache_manager_; const Extensions::Common::DynamicForwardProxy::DnsCacheSharedPtr dns_cache_; Upstream::ClusterManager& cluster_manager_; @@ -36,10 +36,6 @@ class ProxyFilterConfig { using ProxyFilterConfigSharedPtr = std::shared_ptr; -/** - * Implementation of the sni_cluster filter that sets the upstream cluster name from - * the SNI field in the TLS connection. - */ class ProxyFilter : public Network::ReadFilter, public Extensions::Common::DynamicForwardProxy::DnsCache::LoadDnsCacheEntryCallbacks, @@ -59,7 +55,7 @@ class ProxyFilter void onLoadDnsCacheComplete() override; private: - ProxyFilterConfigSharedPtr config_; + const ProxyFilterConfigSharedPtr config_; Extensions::Common::DynamicForwardProxy::DnsCache::LoadDnsCacheEntryHandlePtr cache_load_handle_; Network::ReadFilterCallbacks* read_callbacks_{}; }; From eae66c7390688477a7aea30c5ef18345afa0396c Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Sat, 28 Mar 2020 00:34:48 +0000 Subject: [PATCH 09/15] review Signed-off-by: Lizan Zhou --- .../sni_dynamic_forward_proxy/proxy_filter_integration_test.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc index 163e19593f6e..c846fe543edc 100644 --- a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc +++ b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc @@ -20,6 +20,7 @@ class ProxyFilterIntegrationTest : public testing::TestWithParam Date: Tue, 31 Mar 2020 22:22:09 +0000 Subject: [PATCH 10/15] fix tidy Signed-off-by: Lizan Zhou --- .../network/sni_dynamic_forward_proxy/proxy_filter_test.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc index 6dc027340c53..ef90d0527602 100644 --- a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc +++ b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc @@ -11,7 +11,6 @@ using testing::AtLeast; using testing::Eq; -using testing::InSequence; using testing::Return; using testing::ReturnRef; From 3d6fbb2964f1bfd4c509cf2d54ae6c2bc106dfe7 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Tue, 31 Mar 2020 22:26:36 +0000 Subject: [PATCH 11/15] add todo Signed-off-by: Lizan Zhou --- .../filters/network/sni_dynamic_forward_proxy/proxy_filter.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc index 56a37cd9ba06..cc0d5dca0b7e 100644 --- a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc +++ b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc @@ -34,6 +34,8 @@ Network::FilterStatus ProxyFilter::onNewConnection() { return Network::FilterStatus::Continue; } + // TODO(lizan): implement circuit breaker in SNI dynamic forward proxy + uint16_t default_port = config_->port(); auto result = config_->cache().loadDnsCacheEntry(sni, default_port, *this); From b3f05d72f702074b55dc51d709f76caab4ae45e0 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Wed, 15 Apr 2020 01:39:02 +0000 Subject: [PATCH 12/15] v3 Signed-off-by: Lizan Zhou --- .../sni_dynamic_forward_proxy/v2alpha/BUILD | 12 ------ .../v2alpha/sni_dynamic_forward_proxy.proto | 38 ------------------- .../v3alpha/sni_dynamic_forward_proxy.proto | 5 ++- api/versioning/BUILD | 2 +- 4 files changed, 4 insertions(+), 53 deletions(-) delete mode 100644 api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD delete mode 100644 api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto diff --git a/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD b/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD deleted file mode 100644 index 3068bcca824e..000000000000 --- a/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD +++ /dev/null @@ -1,12 +0,0 @@ -# DO NOT EDIT. This file is generated by tools/proto_sync.py. - -load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") - -licenses(["notice"]) # Apache 2 - -api_proto_package( - deps = [ - "//envoy/config/common/dynamic_forward_proxy/v2alpha:pkg", - "@com_github_cncf_udpa//udpa/annotations:pkg", - ], -) diff --git a/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto b/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto deleted file mode 100644 index 709e1a37a3b3..000000000000 --- a/api/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto +++ /dev/null @@ -1,38 +0,0 @@ -syntax = "proto3"; - -package envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha; - -import "envoy/config/common/dynamic_forward_proxy/v2alpha/dns_cache.proto"; - -import "udpa/annotations/migrate.proto"; -import "udpa/annotations/status.proto"; -import "validate/validate.proto"; - -option java_package = "io.envoyproxy.envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha"; -option java_outer_classname = "SniDynamicForwardProxyProto"; -option java_multiple_files = true; -option (udpa.annotations.file_migrate).move_to_package = - "envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha"; -option (udpa.annotations.file_status).work_in_progress = true; -option (udpa.annotations.file_status).package_version_status = ACTIVE; - -// [#protodoc-title: SNI dynamic forward proxy] - -// Configuration for the SNI-based dynamic forward proxy filter. See the -// :ref:`architecture overview ` for -// more information. Note this filter must be configured along with -// :ref:`TLS inspector listener filter ` to work. -// [#extension: envoy.filters.network.sni_dynamic_forward_proxy] -message FilterConfig { - // The DNS cache configuration that the filter will attach to. Note this - // configuration must match that of associated :ref:`dynamic forward proxy - // cluster configuration - // `. - common.dynamic_forward_proxy.v2alpha.DnsCacheConfig dns_cache_config = 1 - [(validate.rules).message = {required: true}]; - - oneof port_specifier { - // The port number to connect to the upstream. - uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; - } -} diff --git a/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto b/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto index 29bb2745183e..69b881dd24a8 100644 --- a/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto +++ b/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto @@ -12,14 +12,15 @@ option java_package = "io.envoyproxy.envoy.extensions.filters.network.sni_dynami option java_outer_classname = "SniDynamicForwardProxyProto"; option java_multiple_files = true; option (udpa.annotations.file_status).work_in_progress = true; -option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE; +option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: SNI dynamic forward proxy] // Configuration for the SNI-based dynamic forward proxy filter. See the // :ref:`architecture overview ` for // more information. Note this filter must be configured along with -// :ref:`TLS inspector listener filter ` to work. +// :ref:`TLS inspector listener filter ` +// to work. // [#extension: envoy.filters.network.sni_dynamic_forward_proxy] message FilterConfig { option (udpa.annotations.versioning).previous_message_type = diff --git a/api/versioning/BUILD b/api/versioning/BUILD index 173d7a0f1142..21cd386fc94e 100644 --- a/api/versioning/BUILD +++ b/api/versioning/BUILD @@ -96,6 +96,7 @@ proto_library( "//envoy/extensions/filters/network/rbac/v3:pkg", "//envoy/extensions/filters/network/redis_proxy/v3:pkg", "//envoy/extensions/filters/network/sni_cluster/v3:pkg", + "//envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha:pkg", "//envoy/extensions/filters/network/tcp_proxy/v3:pkg", "//envoy/extensions/filters/network/thrift_proxy/filters/ratelimit/v3:pkg", "//envoy/extensions/filters/network/thrift_proxy/v3:pkg", @@ -204,7 +205,6 @@ proto_library( "//envoy/config/filter/network/rbac/v2:pkg", "//envoy/config/filter/network/redis_proxy/v2:pkg", "//envoy/config/filter/network/sni_cluster/v2:pkg", - "//envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha:pkg", "//envoy/config/filter/network/tcp_proxy/v2:pkg", "//envoy/config/filter/network/thrift_proxy/v2alpha1:pkg", "//envoy/config/filter/network/zookeeper_proxy/v1alpha1:pkg", From b787f38d7adc321e89dfe878ba27f29252d5c17b Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Wed, 15 Apr 2020 22:14:16 +0000 Subject: [PATCH 13/15] fix Signed-off-by: Lizan Zhou --- api/BUILD | 1 - .../sni_dynamic_forward_proxy/v3alpha/BUILD | 1 - .../v3alpha/sni_dynamic_forward_proxy.proto | 3 -- .../sni_dynamic_forward_proxy/v2alpha/BUILD | 12 ------ .../v2alpha/sni_dynamic_forward_proxy.proto | 38 ------------------- .../sni_dynamic_forward_proxy/v3alpha/BUILD | 1 - .../v3alpha/sni_dynamic_forward_proxy.proto | 8 ++-- test/config/utility.cc | 12 ------ .../proxy_filter_integration_test.cc | 19 ++-------- .../proxy_filter_integration_test.cc | 32 ++++++---------- test/test_common/network_utility.cc | 12 ++++++ test/test_common/network_utility.h | 6 +++ 12 files changed, 36 insertions(+), 109 deletions(-) delete mode 100644 generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD delete mode 100644 generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto diff --git a/api/BUILD b/api/BUILD index ccdb35e0e52b..2f50226761bb 100644 --- a/api/BUILD +++ b/api/BUILD @@ -76,7 +76,6 @@ proto_library( "//envoy/config/filter/network/rbac/v2:pkg", "//envoy/config/filter/network/redis_proxy/v2:pkg", "//envoy/config/filter/network/sni_cluster/v2:pkg", - "//envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha:pkg", "//envoy/config/filter/network/tcp_proxy/v2:pkg", "//envoy/config/filter/network/thrift_proxy/v2alpha1:pkg", "//envoy/config/filter/network/zookeeper_proxy/v1alpha1:pkg", diff --git a/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD b/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD index c5c4bfd6e0f3..1dcb37e5c342 100644 --- a/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD +++ b/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD @@ -6,7 +6,6 @@ licenses(["notice"]) # Apache 2 api_proto_package( deps = [ - "//envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha:pkg", "//envoy/extensions/common/dynamic_forward_proxy/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", ], diff --git a/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto b/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto index 69b881dd24a8..502a66893174 100644 --- a/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto +++ b/api/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto @@ -23,9 +23,6 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // to work. // [#extension: envoy.filters.network.sni_dynamic_forward_proxy] message FilterConfig { - option (udpa.annotations.versioning).previous_message_type = - "envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha.FilterConfig"; - // The DNS cache configuration that the filter will attach to. Note this // configuration must match that of associated :ref:`dynamic forward proxy // cluster configuration diff --git a/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD b/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD deleted file mode 100644 index 3068bcca824e..000000000000 --- a/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/BUILD +++ /dev/null @@ -1,12 +0,0 @@ -# DO NOT EDIT. This file is generated by tools/proto_sync.py. - -load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") - -licenses(["notice"]) # Apache 2 - -api_proto_package( - deps = [ - "//envoy/config/common/dynamic_forward_proxy/v2alpha:pkg", - "@com_github_cncf_udpa//udpa/annotations:pkg", - ], -) diff --git a/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto b/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto deleted file mode 100644 index 709e1a37a3b3..000000000000 --- a/generated_api_shadow/envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto +++ /dev/null @@ -1,38 +0,0 @@ -syntax = "proto3"; - -package envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha; - -import "envoy/config/common/dynamic_forward_proxy/v2alpha/dns_cache.proto"; - -import "udpa/annotations/migrate.proto"; -import "udpa/annotations/status.proto"; -import "validate/validate.proto"; - -option java_package = "io.envoyproxy.envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha"; -option java_outer_classname = "SniDynamicForwardProxyProto"; -option java_multiple_files = true; -option (udpa.annotations.file_migrate).move_to_package = - "envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha"; -option (udpa.annotations.file_status).work_in_progress = true; -option (udpa.annotations.file_status).package_version_status = ACTIVE; - -// [#protodoc-title: SNI dynamic forward proxy] - -// Configuration for the SNI-based dynamic forward proxy filter. See the -// :ref:`architecture overview ` for -// more information. Note this filter must be configured along with -// :ref:`TLS inspector listener filter ` to work. -// [#extension: envoy.filters.network.sni_dynamic_forward_proxy] -message FilterConfig { - // The DNS cache configuration that the filter will attach to. Note this - // configuration must match that of associated :ref:`dynamic forward proxy - // cluster configuration - // `. - common.dynamic_forward_proxy.v2alpha.DnsCacheConfig dns_cache_config = 1 - [(validate.rules).message = {required: true}]; - - oneof port_specifier { - // The port number to connect to the upstream. - uint32 port_value = 2 [(validate.rules).uint32 = {lte: 65535 gt: 0}]; - } -} diff --git a/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD b/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD index c5c4bfd6e0f3..1dcb37e5c342 100644 --- a/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD +++ b/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/BUILD @@ -6,7 +6,6 @@ licenses(["notice"]) # Apache 2 api_proto_package( deps = [ - "//envoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha:pkg", "//envoy/extensions/common/dynamic_forward_proxy/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", ], diff --git a/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto b/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto index 29bb2745183e..502a66893174 100644 --- a/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto +++ b/generated_api_shadow/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3alpha/sni_dynamic_forward_proxy.proto @@ -12,19 +12,17 @@ option java_package = "io.envoyproxy.envoy.extensions.filters.network.sni_dynami option java_outer_classname = "SniDynamicForwardProxyProto"; option java_multiple_files = true; option (udpa.annotations.file_status).work_in_progress = true; -option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE; +option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: SNI dynamic forward proxy] // Configuration for the SNI-based dynamic forward proxy filter. See the // :ref:`architecture overview ` for // more information. Note this filter must be configured along with -// :ref:`TLS inspector listener filter ` to work. +// :ref:`TLS inspector listener filter ` +// to work. // [#extension: envoy.filters.network.sni_dynamic_forward_proxy] message FilterConfig { - option (udpa.annotations.versioning).previous_message_type = - "envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha.FilterConfig"; - // The DNS cache configuration that the filter will attach to. Note this // configuration must match that of associated :ref:`dynamic forward proxy // cluster configuration diff --git a/test/config/utility.cc b/test/config/utility.cc index a181ba10f179..8ad579e62c1c 100644 --- a/test/config/utility.cc +++ b/test/config/utility.cc @@ -830,18 +830,6 @@ envoy::config::listener::v3::Filter* ConfigHelper::getFilterFromListener(const s return nullptr; } -void ConfigHelper::addListenerFilter(const std::string& filter_yaml) { - RELEASE_ASSERT(!finalized_, ""); - auto* listener = bootstrap_.mutable_static_resources()->mutable_listeners(0); - auto* filter_list_back = listener->add_listener_filters(); - TestUtility::loadFromYaml(filter_yaml, *filter_list_back); - - // Now move it to the front. - for (int i = listener->listener_filters_size() - 1; i > 0; --i) { - listener->mutable_listener_filters()->SwapElements(i, i - 1); - } -} - void ConfigHelper::addNetworkFilter(const std::string& filter_yaml) { RELEASE_ASSERT(!finalized_, ""); auto* filter_chain = diff --git a/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc b/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc index 517c81a089aa..dc607359ca09 100644 --- a/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc +++ b/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc @@ -18,22 +18,11 @@ class ProxyFilterIntegrationTest : public testing::TestWithParammutable_cds_config()->set_path(cds_helper_.cds_path()); bootstrap.mutable_static_resources()->clear_clusters(); - const std::string filter = fmt::format(R"EOF( + const std::string filter = + fmt::format(R"EOF( name: envoy.filters.http.dynamic_forward_proxy typed_config: - "@type": type.googleapis.com/envoy.config.filter.network.sni_dynamic_forward_proxy.v2alpha.FilterConfig + "@type": type.googleapis.com/envoy.extensions.filters.network.sni_dynamic_forward_proxy.v3alpha.FilterConfig dns_cache_config: name: foo dns_lookup_family: {} max_hosts: {} port_value: {} )EOF", - ipVersionToDnsFamily(GetParam()), max_hosts, - fake_upstreams_[0]->localAddress()->ip()->port()); + Network::Test::ipVersionToDnsFamily(GetParam()), max_hosts, + fake_upstreams_[0]->localAddress()->ip()->port()); config_helper_.addNetworkFilter(filter); }); @@ -69,13 +59,13 @@ name: envoy.filters.http.dynamic_forward_proxy fmt::format(R"EOF( name: envoy.clusters.dynamic_forward_proxy typed_config: - "@type": type.googleapis.com/envoy.config.cluster.dynamic_forward_proxy.v2alpha.ClusterConfig + "@type": type.googleapis.com/envoy.extensions.clusters.dynamic_forward_proxy.v3.ClusterConfig dns_cache_config: name: foo dns_lookup_family: {} max_hosts: {} )EOF", - ipVersionToDnsFamily(GetParam()), max_hosts); + Network::Test::ipVersionToDnsFamily(GetParam()), max_hosts); TestUtility::loadFromYaml(cluster_type_config, *cluster_.mutable_cluster_type()); diff --git a/test/test_common/network_utility.cc b/test/test_common/network_utility.cc index 6d4d4fb09bad..1f40191733f1 100644 --- a/test/test_common/network_utility.cc +++ b/test/test_common/network_utility.cc @@ -159,6 +159,18 @@ bool supportsIpVersion(const Address::IpVersion version) { return true; } +std::string ipVersionToDnsFamily(Network::Address::IpVersion version) { + switch (version) { + case Network::Address::IpVersion::v4: + return "V4_ONLY"; + case Network::Address::IpVersion::v6: + return "V6_ONLY"; + } + + // This seems to be needed on the coverage build for some reason. + NOT_REACHED_GCOVR_EXCL_LINE; +} + std::pair bindFreeLoopbackPort(Address::IpVersion version, Address::SocketType type) { Address::InstanceConstSharedPtr addr = getCanonicalLoopbackAddress(version); diff --git a/test/test_common/network_utility.h b/test/test_common/network_utility.h index 4a7a7d05a4c4..965ec8b6dfad 100644 --- a/test/test_common/network_utility.h +++ b/test/test_common/network_utility.h @@ -100,6 +100,12 @@ Address::InstanceConstSharedPtr getAnyAddress(const Address::IpVersion version, */ bool supportsIpVersion(const Address::IpVersion version); +/** + * Returns the DNS family for the specified IP version. + * @param version the IP version of the DNS lookup family. + */ +std::string ipVersionToDnsFamily(Network::Address::IpVersion version); + /** * Bind a socket to a free port on a loopback address, and return the socket's fd and bound address. * Enables a test server to reliably "select" a port to listen on. Note that the socket option From 2a7cffff33692877ccc4c49ba6bff9436639d23b Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Wed, 15 Apr 2020 22:34:53 +0000 Subject: [PATCH 14/15] other review comment Signed-off-by: Lizan Zhou --- .../network/sni_dynamic_forward_proxy/proxy_filter.cc | 5 +++-- .../filters/network/sni_dynamic_forward_proxy/proxy_filter.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc index cc0d5dca0b7e..d9eeceb12098 100644 --- a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc +++ b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc @@ -34,9 +34,10 @@ Network::FilterStatus ProxyFilter::onNewConnection() { return Network::FilterStatus::Continue; } - // TODO(lizan): implement circuit breaker in SNI dynamic forward proxy + // TODO(lizan): implement circuit breaker in SNI dynamic forward proxy like it is in HTTP: + // https://github.com/envoyproxy/envoy/blob/master/source/extensions/filters/http/dynamic_forward_proxy/proxy_filter.cc#L65 - uint16_t default_port = config_->port(); + uint32_t default_port = config_->port(); auto result = config_->cache().loadDnsCacheEntry(sni, default_port, *this); diff --git a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h index 47c42aa4dbba..49f66aba3fb6 100644 --- a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h +++ b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.h @@ -25,10 +25,10 @@ class ProxyFilterConfig { Extensions::Common::DynamicForwardProxy::DnsCache& cache() { return *dns_cache_; } Upstream::ClusterManager& clusterManager() { return cluster_manager_; } - uint16_t port() { return port_; } + uint32_t port() { return port_; } private: - const uint16_t port_; + const uint32_t port_; const Extensions::Common::DynamicForwardProxy::DnsCacheManagerSharedPtr dns_cache_manager_; const Extensions::Common::DynamicForwardProxy::DnsCacheSharedPtr dns_cache_; Upstream::ClusterManager& cluster_manager_; From 8bfec4abfd780c67d7e9e165597b795e42b8adf1 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Wed, 15 Apr 2020 22:48:57 +0000 Subject: [PATCH 15/15] fix docs Signed-off-by: Lizan Zhou --- .../api-v3/config/filter/network/network.rst | 3 +- docs/root/intro/version_history.rst | 1213 ----------------- docs/root/version_history/version_history.rst | 42 + 3 files changed, 43 insertions(+), 1215 deletions(-) delete mode 100644 docs/root/intro/version_history.rst create mode 100644 docs/root/version_history/version_history.rst diff --git a/docs/root/api-v3/config/filter/network/network.rst b/docs/root/api-v3/config/filter/network/network.rst index 7db2ad7b427d..65f103bd6d7a 100644 --- a/docs/root/api-v3/config/filter/network/network.rst +++ b/docs/root/api-v3/config/filter/network/network.rst @@ -6,5 +6,4 @@ Network filters :maxdepth: 2 */empty/* - ../../../extensions/filters/network/*/v3/* - ../../../extensions/filters/network/*/v3alpha/* + ../../../extensions/filters/network/*/v3*/* diff --git a/docs/root/intro/version_history.rst b/docs/root/intro/version_history.rst deleted file mode 100644 index 6b1467e336f4..000000000000 --- a/docs/root/intro/version_history.rst +++ /dev/null @@ -1,1213 +0,0 @@ -Version history ---------------- - -1.14.0 (Pending) -================ -* access log: added support for DOWNSTREAM_LOCAL_PORT :ref:`access log formatters `. -* access loggers: access logger extensions use the "envoy.access_loggers" name space. A mapping - of extension names is available in the :ref:`deprecated ` documentation. -* access log: fix %DOWSTREAM_DIRECT_REMOTE_ADDRESS% when used with PROXY protocol listener filter -* access log: introduce :ref:`connection-level access loggers`. -* adaptive concurrency: fixed bug that allowed concurrency limits to drop below the configured - minimum. -* admin: added support for displaying ip address subject alternate names in :ref:`certs` end point. -* admin: added :http:post:`/reopen_logs` endpoint to control log rotation. -* aws_lambda: added :ref:`AWS Lambda filter ` that converts HTTP requests to Lambda - invokes. This effectively makes Envoy act as an egress gateway to AWS Lambda. -* aws_request_signing: a few fixes so that it works with S3. -* buffer: force copy when appending small slices to OwnedImpl buffer to avoid fragmentation. -* config: use type URL to select an extension whenever the config type URL (or its previous versions) uniquely identify a typed extension, see :ref:`extension configuration `. -* grpc-json: added support for building HTTP request into - `google.api.HttpBody `_. -* grpc-stats: add options to limit which messages stats are created for. -* config: added stat :ref:`update_time `. -* datasource: added retry policy for remote async data source. -* dns: the STRICT_DNS cluster now only resolves to 0 hosts if DNS resolution successfully returns 0 hosts. -* dns: added support for :ref:`dns_failure_refresh_rate ` for the :ref:`dns cache ` to set the DNS refresh rate during failures. -* dynamic forward proxy: added :ref:`SNI based dynamic forward proxy ` support. -* http filters: http filter extensions use the "envoy.filters.http" name space. A mapping - of extension names is available in the :ref:`deprecated ` documentation. -* ext_authz: disabled the use of lowercase string matcher for headers matching in HTTP-based `ext_authz`. - Can be reverted temporarily by setting runtime feature `envoy.reloadable_features.ext_authz_http_service_enable_case_sensitive_string_matcher` to false. -* fault: added support for controlling abort faults with :ref:`HTTP header fault configuration ` to the HTTP fault filter. -* http: added HTTP/1.1 flood protection. Can be temporarily disabled using the runtime feature `envoy.reloadable_features.http1_flood_protection` -* http: fixing a bug in HTTP/1.0 responses where Connection: keep-alive was not appended for connections which were kept alive. -* http: fixed a bug that could send extra METADATA frames and underflow memory when encoding METADATA frames on a connection that was dispatching data. -* http: connection header sanitizing has been modified to always sanitize if there is no upgrade, including when an h2c upgrade attempt has been removed. -* http: added :ref:`max_stream_duration ` to specify the duration of existing streams. See :ref:`connection and stream timeouts `. -* http: upgrade parser library, which removes support for "identity" transfer-encoding value. -* http: the runtime feature `http.connection_manager.log_flood_exception` is removed and replaced with a connection access log response code. -* listener filters: listener filter extensions use the "envoy.filters.listener" name space. A - mapping of extension names is available in the :ref:`deprecated ` documentation. -* listeners: fixed issue where :ref:`TLS inspector listener filter ` could have been bypassed by a client using only TLS 1.3. -* loadbalancing: added support for using hostname for consistent hash loadbalancing via :ref:`consistent_hash_lb_config `. -* lua: added a parameter to `httpCall` that makes it possible to have the call be asynchronous. -* lua: added moonjit support. -* mongo: the stat emitted for queries without a max time set in the :ref:`MongoDB filter` was modified to emit correctly for Mongo v3.2+. -* network filters: network filter extensions use the "envoy.filters.network" name space. A mapping - of extension names is available in the :ref:`deprecated ` documentation. -* network filters: added a :ref:`direct response filter `. -* rbac: added :ref:`url_path ` for matching URL path without the query and fragment string. -* request_id_extension: add an ability to extend request ID handling at :ref:`HTTP connection manager`. -* retry: added a retry predicate that :ref:`rejects hosts based on metadata. ` -* router: added additional stats for :ref:`virtual clusters `. -* router: added :ref:`auto_san_validation ` to support overrriding SAN validation to transport socket for new upstream connections based on the downstream HTTP host/authority header. -* router: added the ability to match a route based on whether a downstream TLS connection certificate has been - :ref:`validated `. -* router: added support for :ref:`regex_rewrite - ` for path rewriting using regular expressions and capture groups. -* router: don't ignore :ref:`per_try_timeout ` when the :ref:`global route timeout ` is disabled. -* router: added ability to set attempt count in downstream response, see :ref:`virtual host's include response - attempt count config `. -* router: strip whitespace for :ref:`retry_on `, :ref:`grpc-retry-on header ` and :ref:`retry-on header `. -* router: added support for DOWNSTREAM_LOCAL_PORT :ref:`header formatter `. -* runtime: enabling the runtime feature "envoy.deprecated_features.allow_deprecated_extension_names" - disables the use of deprecated extension names. -* runtime: integer values may now be parsed as booleans. -* sds: added :ref:`GenericSecret ` to support secret of generic type. -* sds: fix the SDS vulnerability that TLS validation context (e.g., subject alt name or hash) cannot be effectively validated in some cases. -* stat sinks: stat sink extensions use the "envoy.stat_sinks" name space. A mapping of extension - names is available in the :ref:`deprecated ` documentation. -* thrift_proxy: add router filter stats to docs. -* tracers: tracer extensions use the "envoy.tracers" name space. A mapping of extension names is - available in the :ref:`deprecated ` documentation. -* tracing: added gRPC service configuration to the OpenCensus Stackdriver and OpenCensus Agent tracers. -* upstream: added ``upstream_rq_retry_limit_exceeded`` to :ref:`cluster `, and :ref:`virtual cluster ` stats. -* upstream: combined HTTP/1 and HTTP/2 connection pool code. This means that circuit breaker - limits for both requests and connections apply to both pool types. Also, HTTP/2 now has - the option to limit concurrent requests on a connection, and allow multiple draining - connections. The old behavior is deprecated, but can be used during the deprecation - period by disabling runtime feature "envoy.reloadable_features.new_http1_connection_pool_behavior" or - "envoy.reloadable_features.new_http2_connection_pool_behavior" and then re-configure your clusters or - restart Envoy. The behavior will not switch until the connection pools are recreated. The new - circuit breaker behavior is described :ref:`here `. -* upstream: changed load distribution algorithm when all priorities enter :ref:`panic mode`. - -1.13.1 (March 3, 2020) -====================== -* buffer: force copy when appending small slices to OwnedImpl buffer to avoid fragmentation. -* http: added HTTP/1.1 flood protection. Can be temporarily disabled using the runtime feature `envoy.reloadable_features.http1_flood_protection`. -* listeners: fixed issue where :ref:`TLS inspector listener filter ` could have been bypassed by a client using only TLS 1.3. -* rbac: added :ref:`url_path ` for matching URL path without the query and fragment string. -* sds: fixed the SDS vulnerability that TLS validation context (e.g., subject alt name or hash) cannot be effectively validated in some cases. - -1.13.0 (January 20, 2020) -========================= -* access log: added FILTER_STATE :ref:`access log formatters ` and gRPC access logger. -* admin: added the ability to filter :ref:`/config_dump `. -* access log: added a :ref:`typed JSON logging mode ` to output access logs in JSON format with non-string values -* access log: fixed UPSTREAM_LOCAL_ADDRESS :ref:`access log formatters ` to work for http requests -* access log: added HOSTNAME. -* api: remove all support for v1 -* api: added ability to specify `mode` for :ref:`Pipe `. -* api: support for the v3 xDS API added. See :ref:`api_supported_versions`. -* aws_request_signing: added new alpha :ref:`HTTP AWS request signing filter `. -* buffer: remove old implementation -* build: official released binary is now built against libc++. -* cluster: added :ref:`aggregate cluster ` that allows load balancing between clusters. -* config: all category names of internal envoy extensions are prefixed with the 'envoy.' prefix to follow the reverse DNS naming notation. -* decompressor: remove decompressor hard assert failure and replace with an error flag. -* ext_authz: added :ref:`configurable ability` to send the :ref:`certificate` to the `ext_authz` service. -* fault: fixed an issue where the http fault filter would repeatedly check the percentage of abort/delay when the `x-envoy-downstream-service-cluster` header was included in the request to ensure that the actual percentage of abort/delay matches the configuration of the filter. -* health check: gRPC health checker sets the gRPC deadline to the configured timeout duration. -* health check: added :ref:`TlsOptions ` to allow TLS configuration overrides. -* health check: added :ref:`service_name_matcher ` to better compare the service name patterns for health check identity. -* http: added strict validation that CONNECT is refused as it is not yet implemented. This can be reversed temporarily by setting the runtime feature `envoy.reloadable_features.strict_method_validation` to false. -* http: added support for http1 trailers. To enable use :ref:`enable_trailers `. -* http: added the ability to sanitize headers nominated by the Connection header. This new behavior is guarded by envoy.reloadable_features.connection_header_sanitization which defaults to true. -* http: blocks unsupported transfer-encodings. Can be reverted temporarily by setting runtime feature `envoy.reloadable_features.reject_unsupported_transfer_encodings` to false. -* http: support :ref:`auto_host_rewrite_header` in the dynamic forward proxy. -* jwt_authn: added :ref:`allow_missing` option that accepts request without token but rejects bad request with bad tokens. -* jwt_authn: added :ref:`bypass_cors_preflight` to allow bypassing the CORS preflight request. -* lb_subset_config: new fallback policy for selectors: :ref:`KEYS_SUBSET` -* listeners: added :ref:`reuse_port` option. -* logger: added :ref:`--log-format-escaped ` command line option to escape newline characters in application logs. -* ratelimit: added :ref:`local rate limit ` network filter. -* rbac: added support for matching all subject alt names instead of first in :ref:`principal_name `. -* redis: performance improvement for larger split commands by avoiding string copies. -* redis: correctly follow MOVE/ASK redirection for mirrored clusters. -* redis: add :ref:`host_degraded_refresh_threshold ` and :ref:`failure_refresh_threshold ` to refresh topology when nodes are degraded or when requests fails. -* router: added histograms to show timeout budget usage to the :ref:`cluster stats `. -* router check tool: added support for testing and marking coverage for routes of runtime fraction 0. -* router: added :ref:`request_mirror_policies` to support sending multiple mirrored requests in one route. -* router: added support for REQ(header-name) :ref:`header formatter `. -* router: added support for percentage-based :ref:`retry budgets ` -* router: allow using a :ref:`query parameter ` for HTTP consistent hashing. -* router: exposed DOWNSTREAM_REMOTE_ADDRESS as custom HTTP request/response headers. -* router: added support for :ref:`max_internal_redirects ` for configurable maximum internal redirect hops. -* router: skip the Location header when the response code is not a 201 or a 3xx. -* router: added :ref:`auto_sni ` to support setting SNI to transport socket for new upstream connections based on the downstream HTTP host/authority header. -* router: added support for HOSTNAME :ref:`header formatter - `. -* server: added the :option:`--disable-extensions` CLI option, to disable extensions at startup. -* server: fixed a bug in config validation for configs with runtime layers. -* server: added :ref:`workers_started ` that indicates whether listeners have been fully initialized on workers. -* tcp_proxy: added :ref:`ClusterWeight.metadata_match`. -* tcp_proxy: added :ref:`hash_policy`. -* thrift_proxy: added support for cluster header based routing. -* thrift_proxy: added stats to the router filter. -* tls: remove TLS 1.0 and 1.1 from client defaults -* tls: added support for :ref:`generic string matcher ` for subject alternative names. -* tracing: added the ability to set custom tags on both the :ref:`HTTP connection manager` and the :ref:`HTTP route `. -* tracing: added upstream_address tag. -* tracing: added initial support for AWS X-Ray (local sampling rules only) :ref:`X-Ray Tracing `. -* tracing: added tags for gRPC request path, authority, content-type and timeout. -* udp: added initial support for :ref:`UDP proxy ` - -1.12.3 (March 3, 2020) -====================== -* buffer: force copy when appending small slices to OwnedImpl buffer to avoid fragmentation. -* http: added HTTP/1.1 flood protection. Can be temporarily disabled using the runtime feature `envoy.reloadable_features.http1_flood_protection`. -* listeners: fixed issue where :ref:`TLS inspector listener filter ` could have been bypassed by a client using only TLS 1.3. -* rbac: added :ref:`url_path ` for matching URL path without the query and fragment string. -* sds: fixed the SDS vulnerability that TLS validation context (e.g., subject alt name or hash) cannot be effectively validated in some cases. - -1.12.2 (December 10, 2019) -========================== -* http: fixed CVE-2019-18801 by allocating sufficient memory for request headers. -* http: fixed CVE-2019-18802 by implementing stricter validation of HTTP/1 headers. -* http: trim LWS at the end of header keys, for correct HTTP/1.1 header parsing. -* http: added strict authority checking. This can be reversed temporarily by setting the runtime feature `envoy.reloadable_features.strict_authority_validation` to false. -* route config: fixed CVE-2019-18838 by checking for presence of host/path headers. - -1.12.1 (November 8, 2019) -========================= -* listener: fixed CVE-2019-18836 by clearing accept filters before connection creation. - -1.12.0 (October 31, 2019) -========================= -* access log: added a new flag for :ref:`downstream protocol error `. -* access log: added :ref:`buffering ` and :ref:`periodical flushing ` support to gRPC access logger. Defaults to 16KB buffer and flushing every 1 second. -* access log: added DOWNSTREAM_DIRECT_REMOTE_ADDRESS and DOWNSTREAM_DIRECT_REMOTE_ADDRESS_WITHOUT_PORT :ref:`access log formatters ` and gRPC access logger. -* access log: gRPC Access Log Service (ALS) support added for :ref:`TCP access logs `. -* access log: reintroduced :ref:`filesystem ` stats and added the `write_failed` counter to track failed log writes. -* admin: added ability to configure listener :ref:`socket options `. -* admin: added config dump support for Secret Discovery Service :ref:`SecretConfigDump `. -* admin: added support for :ref:`draining ` listeners via admin interface. -* admin: added :http:get:`/stats/recentlookups`, :http:post:`/stats/recentlookups/clear`, :http:post:`/stats/recentlookups/disable`, and :http:post:`/stats/recentlookups/enable` endpoints. -* api: added :ref:`set_node_on_first_message_only ` option to omit the node identifier from the subsequent discovery requests on the same stream. -* buffer filter: now populates content-length header if not present. This behavior can be temporarily disabled using the runtime feature `envoy.reloadable_features.buffer_filter_populate_content_length`. -* build: official released binary is now PIE so it can be run with ASLR. -* config: added support for :ref:`delta xDS ` (including ADS) delivery. -* config: enforcing that terminal filters (e.g. HttpConnectionManager for L4, router for L7) be the last in their respective filter chains. -* config: added access log :ref:`extension filter`. -* config: added support for :option:`--reject-unknown-dynamic-fields`, providing independent control - over whether unknown fields are rejected in static and dynamic configuration. By default, unknown - fields in static configuration are rejected and are allowed in dynamic configuration. Warnings - are logged for the first use of any unknown field and these occurrences are counted in the - :ref:`server.static_unknown_fields ` and :ref:`server.dynamic_unknown_fields - ` statistics. -* config: added async data access for local and remote data sources. -* config: changed the default value of :ref:`initial_fetch_timeout ` from 0s to 15s. This is a change in behaviour in the sense that Envoy will move to the next initialization phase, even if the first config is not delivered in 15s. Refer to :ref:`initialization process ` for more details. -* config: added stat :ref:`init_fetch_timeout `. -* config: tls_context in Cluster and FilterChain are deprecated in favor of transport socket. See :ref:`deprecated documentation` for more information. -* csrf: added PATCH to supported methods. -* dns: added support for configuring :ref:`dns_failure_refresh_rate ` to set the DNS refresh rate during failures. -* ext_authz: added :ref:`configurable ability ` to send dynamic metadata to the `ext_authz` service. -* ext_authz: added :ref:`filter_enabled RuntimeFractionalPercent flag ` to filter. -* ext_authz: added tracing to the HTTP client. -* ext_authz: deprecated :ref:`cluster scope stats ` in favour of filter scope stats. -* fault: added overrides for default runtime keys in :ref:`HTTPFault ` filter. -* grpc: added :ref:`AWS IAM grpc credentials extension ` for AWS-managed xDS. -* grpc: added :ref:`gRPC stats filter ` for collecting stats about gRPC calls and streaming message counts. -* grpc-json: added support for :ref:`ignoring unknown query parameters`. -* grpc-json: added support for :ref:`the grpc-status-details-bin header`. -* header to metadata: added :ref:`PROTOBUF_VALUE ` and :ref:`ValueEncode ` to support protobuf Value and Base64 encoding. -* http: added a default one hour idle timeout to upstream and downstream connections. HTTP connections with no streams and no activity will be closed after one hour unless the default idle_timeout is overridden. To disable upstream idle timeouts, set the :ref:`idle_timeout ` to zero in Cluster :ref:`http_protocol_options`. To disable downstream idle timeouts, either set :ref:`idle_timeout ` to zero in the HttpConnectionManager :ref:`common_http_protocol_options ` or set the deprecated :ref:`connection manager ` field to zero. -* http: added the ability to format HTTP/1.1 header keys using :ref:`header_key_format `. -* http: added the ability to reject HTTP/1.1 requests with invalid HTTP header values, using the runtime feature `envoy.reloadable_features.strict_header_validation`. -* http: changed Envoy to forward existing x-forwarded-proto from upstream trusted proxies. Guarded by `envoy.reloadable_features.trusted_forwarded_proto` which defaults true. -* http: added the ability to configure the behavior of the server response header, via the :ref:`server_header_transformation` field. -* http: added the ability to :ref:`merge adjacent slashes` in the path. -* http: :ref:`AUTO ` codec protocol inference now requires the H2 magic bytes to be the first bytes transmitted by a downstream client. -* http: remove h2c upgrade headers for HTTP/1 as h2c upgrades are currently not supported. -* http: absolute URL support is now on by default. The prior behavior can be reinstated by setting :ref:`allow_absolute_url ` to false. -* http: support :ref:`host rewrite ` in the dynamic forward proxy. -* http: support :ref:`disabling the filter per route ` in the grpc http1 reverse bridge filter. -* http: added the ability to :ref:`configure max connection duration ` for downstream connections. -* listeners: added :ref:`continue_on_listener_filters_timeout ` to configure whether a listener will still create a connection when listener filters time out. -* listeners: added :ref:`HTTP inspector listener filter `. -* listeners: added :ref:`connection balancer ` - configuration for TCP listeners. -* listeners: listeners now close the listening socket as part of the draining stage as soon as workers stop accepting their connections. -* lua: extended `httpCall()` and `respond()` APIs to accept headers with entry values that can be a string or table of strings. -* lua: extended `dynamicMetadata:set()` to allow setting complex values. -* metrics_service: added support for flushing histogram buckets. -* outlier_detector: added :ref:`support for the grpc-status response header ` by mapping it to HTTP status. Guarded by envoy.reloadable_features.outlier_detection_support_for_grpc_status which defaults to true. -* performance: new buffer implementation enabled by default (to disable add "--use-libevent-buffers 1" to the command-line arguments when starting Envoy). -* performance: stats symbol table implementation (disabled by default; to test it, add "--use-fake-symbol-table 0" to the command-line arguments when starting Envoy). -* rbac: added support for DNS SAN as :ref:`principal_name `. -* redis: added :ref:`enable_command_stats ` to enable :ref:`per command statistics ` for upstream clusters. -* redis: added :ref:`read_policy ` to allow reading from redis replicas for Redis Cluster deployments. -* redis: fixed a bug where the redis health checker ignored the upstream auth password. -* redis: enable_hashtaging is always enabled when the upstream uses open source Redis cluster protocol. -* regex: introduced new :ref:`RegexMatcher ` type that - provides a safe regex implementation for untrusted user input. This type is now used in all - configuration that processes user provided input. See :ref:`deprecated configuration details - ` for more information. -* rbac: added conditions to the policy, see :ref:`condition `. -* router: added :ref:`rq_retry_skipped_request_not_complete ` counter stat to router stats. -* router: :ref:`scoped routing ` is supported. -* router: added new :ref:`retriable-headers ` retry policy. Retries can now be configured to trigger by arbitrary response header matching. -* router: added ability for most specific header mutations to take precedence, see :ref:`route configuration's most specific - header mutations wins flag `. -* router: added :ref:`respect_expected_rq_timeout ` that instructs ingress Envoy to respect :ref:`config_http_filters_router_x-envoy-expected-rq-timeout-ms` header, populated by egress Envoy, when deriving timeout for upstream cluster. -* router: added new :ref:`retriable request headers ` to route configuration, to allow limiting buffering for retries and shadowing. -* router: added new :ref:`retriable request headers ` to retry policies. Retries can now be configured to only trigger on request header match. -* router: added the ability to match a route based on whether a TLS certificate has been - :ref:`presented ` by the - downstream connection. -* router check tool: added coverage reporting & enforcement. -* router check tool: added comprehensive coverage reporting. -* router check tool: added deprecated field check. -* router check tool: added flag for only printing results of failed tests. -* router check tool: added support for outputting missing tests in the detailed coverage report. -* router check tool: added coverage reporting for direct response routes. -* runtime: allows for the ability to parse boolean values. -* runtime: allows for the ability to parse integers as double values and vice-versa. -* sds: added :ref:`session_ticket_keys_sds_secret_config ` for loading TLS Session Ticket Encryption Keys using SDS API. -* server: added a post initialization lifecycle event, in addition to the existing startup and shutdown events. -* server: added :ref:`per-handler listener stats ` and - :ref:`per-worker watchdog stats ` to help diagnosing event - loop imbalance and general performance issues. -* stats: added unit support to histogram. -* tcp_proxy: the default :ref:`idle_timeout - ` is now 1 hour. -* thrift_proxy: fixed crashing bug on invalid transport/protocol framing. -* thrift_proxy: added support for stripping service name from method when using the multiplexed protocol. -* tls: added verification of IP address SAN fields in certificates against configured SANs in the certificate validation context. -* tracing: added support to the Zipkin reporter for sending list of spans as Zipkin JSON v2 and protobuf message over HTTP. - certificate validation context. -* tracing: added tags for gRPC response status and message. -* tracing: added :ref:`max_path_tag_length ` to support customizing the length of the request path included in the extracted `http.url `_ tag. -* upstream: added :ref:`an option ` that allows draining HTTP, TCP connection pools on cluster membership change. -* upstream: added :ref:`transport_socket_matches `, support using different transport socket config when connecting to different upstream endpoints within a cluster. -* upstream: added network filter chains to upstream connections, see :ref:`filters`. -* upstream: added new :ref:`failure-percentage based outlier detection` mode. -* upstream: uses p2c to select hosts for least-requests load balancers if all host weights are the same, even in cases where weights are not equal to 1. -* upstream: added :ref:`fail_traffic_on_panic ` to allow failing all requests to a cluster during panic state. -* zookeeper: parses responses and emits latency stats. - -1.11.2 (October 8, 2019) -======================== -* http: fixed CVE-2019-15226 by adding a cached byte size in HeaderMap. -* http: added :ref:`max headers count ` for http connections. The default limit is 100. -* upstream: runtime feature `envoy.reloadable_features.max_response_headers_count` overrides the default limit for upstream :ref:`max headers count ` -* http: added :ref:`common_http_protocol_options ` - Runtime feature `envoy.reloadable_features.max_request_headers_count` overrides the default limit for downstream :ref:`max headers count ` -* regex: backported safe regex matcher fix for CVE-2019-15225. - -1.11.1 (August 13, 2019) -======================== -* http: added mitigation of client initiated attacks that result in flooding of the downstream HTTP/2 connections. Those attacks can be logged at the "warning" level when the runtime feature `http.connection_manager.log_flood_exception` is enabled. The runtime setting defaults to disabled to avoid log spam when under attack. -* http: added :ref:`inbound_empty_frames_flood ` counter stat to the HTTP/2 codec stats, for tracking number of connections terminated for exceeding the limit on consecutive inbound frames with an empty payload and no end stream flag. The limit is configured by setting the :ref:`max_consecutive_inbound_frames_with_empty_payload config setting `. - Runtime feature `envoy.reloadable_features.http2_protocol_options.max_consecutive_inbound_frames_with_empty_payload` overrides :ref:`max_consecutive_inbound_frames_with_empty_payload setting `. Large override value (i.e. 2147483647) effectively disables mitigation of inbound frames with empty payload. -* http: added :ref:`inbound_priority_frames_flood ` counter stat to the HTTP/2 codec stats, for tracking number of connections terminated for exceeding the limit on inbound PRIORITY frames. The limit is configured by setting the :ref:`max_inbound_priority_frames_per_stream config setting `. - Runtime feature `envoy.reloadable_features.http2_protocol_options.max_inbound_priority_frames_per_stream` overrides :ref:`max_inbound_priority_frames_per_stream setting `. Large override value effectively disables flood mitigation of inbound PRIORITY frames. -* http: added :ref:`inbound_window_update_frames_flood ` counter stat to the HTTP/2 codec stats, for tracking number of connections terminated for exceeding the limit on inbound WINDOW_UPDATE frames. The limit is configured by setting the :ref:`max_inbound_window_update_frames_per_data_frame_sent config setting `. - Runtime feature `envoy.reloadable_features.http2_protocol_options.max_inbound_window_update_frames_per_data_frame_sent` overrides :ref:`max_inbound_window_update_frames_per_data_frame_sent setting `. Large override value effectively disables flood mitigation of inbound WINDOW_UPDATE frames. -* http: added :ref:`outbound_flood ` counter stat to the HTTP/2 codec stats, for tracking number of connections terminated for exceeding the outbound queue limit. The limit is configured by setting the :ref:`max_outbound_frames config setting ` - Runtime feature `envoy.reloadable_features.http2_protocol_options.max_outbound_frames` overrides :ref:`max_outbound_frames config setting `. Large override value effectively disables flood mitigation of outbound frames of all types. -* http: added :ref:`outbound_control_flood ` counter stat to the HTTP/2 codec stats, for tracking number of connections terminated for exceeding the outbound queue limit for PING, SETTINGS and RST_STREAM frames. The limit is configured by setting the :ref:`max_outbound_control_frames config setting `. - Runtime feature `envoy.reloadable_features.http2_protocol_options.max_outbound_control_frames` overrides :ref:`max_outbound_control_frames config setting `. Large override value effectively disables flood mitigation of outbound frames of types PING, SETTINGS and RST_STREAM. -* http: enabled strict validation of HTTP/2 messaging. Previous behavior can be restored using :ref:`stream_error_on_invalid_http_messaging config setting `. - Runtime feature `envoy.reloadable_features.http2_protocol_options.stream_error_on_invalid_http_messaging` overrides :ref:`stream_error_on_invalid_http_messaging config setting `. - -1.11.0 (July 11, 2019) -====================== -* access log: added a new field for downstream TLS session ID to file and gRPC access logger. -* access log: added a new field for route name to file and gRPC access logger. -* access log: added a new field for response code details in :ref:`file access logger` and :ref:`gRPC access logger`. -* access log: added several new variables for exposing information about the downstream TLS connection to :ref:`file access logger` and :ref:`gRPC access logger`. -* access log: added a new flag for request rejected due to failed strict header check. -* admin: the administration interface now includes a :ref:`/ready endpoint ` for easier readiness checks. -* admin: extend :ref:`/runtime_modify endpoint ` to support parameters within the request body. -* admin: the :ref:`/listener endpoint ` now returns :ref:`listeners.proto` which includes listener names and ports. -* admin: added host priority to :http:get:`/clusters` and :http:get:`/clusters?format=json` endpoint response -* admin: the :ref:`/clusters endpoint ` now shows hostname - for each host, useful for DNS based clusters. -* api: track and report requests issued since last load report. -* build: releases are built with Clang and linked with LLD. -* config: added :ref:stats_server_version_override` ` in bootstrap, that can be used to override :ref:`server.version statistic `. -* control-plane: management servers can respond with HTTP 304 to indicate that config is up to date for Envoy proxies polling a :ref:`REST API Config Type ` -* csrf: added support for whitelisting additional source origins. -* dns: added support for getting DNS record TTL which is used by STRICT_DNS/LOGICAL_DNS cluster as DNS refresh rate. -* dubbo_proxy: support the :ref:`dubbo proxy filter `. -* dynamo_request_parser: adding support for transactions. Adds check for new types of dynamodb operations (TransactWriteItems, TransactGetItems) and awareness for new types of dynamodb errors (IdempotentParameterMismatchException, TransactionCanceledException, TransactionInProgressException). -* eds: added support to specify max time for which endpoints can be used :ref:`gRPC filter `. -* eds: removed max limit for `load_balancing_weight`. -* event: added :ref:`loop duration and poll delay statistics `. -* ext_authz: added a `x-envoy-auth-partial-body` metadata header set to `false|true` indicating if there is a partial body sent in the authorization request message. -* ext_authz: added configurable status code that allows customizing HTTP responses on filter check status errors. -* ext_authz: added option to `ext_authz` that allows the filter clearing route cache. -* grpc-json: added support for :ref:`auto mapping - `. -* health check: added :ref:`initial jitter ` to add jitter to the first health check in order to prevent thundering herd on Envoy startup. -* hot restart: stats are no longer shared between hot restart parent/child via shared memory, but rather by RPC. Hot restart version incremented to 11. -* http: added the ability to pass a URL encoded PEM encoded peer certificate chain in the - :ref:`config_http_conn_man_headers_x-forwarded-client-cert` header. -* http: fixed a bug where large unbufferable responses were not tracked in stats and logs correctly. -* http: fixed a crashing bug where gRPC local replies would cause segfaults when upstream access logging was on. -* http: mitigated a race condition with the :ref:`delayed_close_timeout` where it could trigger while actively flushing a pending write buffer for a downstream connection. -* http: added support for :ref:`preserve_external_request_id` that represents whether the x-request-id should not be reset on edge entry inside mesh -* http: changed `sendLocalReply` to send percent-encoded `GrpcMessage`. -* http: added a :ref:header_prefix` ` configuration option to allow Envoy to send and process x-custom- prefixed headers rather than x-envoy. -* http: added :ref:`dynamic forward proxy ` support. -* http: tracking the active stream and dumping state in Envoy crash handlers. This can be disabled by building with `--define disable_object_dump_on_signal_trace=disabled` -* jwt_authn: make filter's parsing of JWT more flexible, allowing syntax like ``jwt=eyJhbGciOiJS...ZFnFIw,extra=7,realm=123`` -* listener: added :ref:`source IP ` - and :ref:`source port ` filter - chain matching. -* lua: exposed functions to Lua to verify digital signature. -* original_src filter: added the :ref:`filter`. -* outlier_detector: added configuration :ref:`outlier_detection.split_external_local_origin_errors` to distinguish locally and externally generated errors. See :ref:`arch_overview_outlier_detection` for full details. -* rbac: migrated from v2alpha to v2. -* redis: add support for Redis cluster custom cluster type. -* redis: automatically route commands using cluster slots for Redis cluster. -* redis: added :ref:`prefix routing ` to enable routing commands based on their key's prefix to different upstream. -* redis: added :ref:`request mirror policy ` to enable shadow traffic and/or dual writes. -* redis: add support for zpopmax and zpopmin commands. -* redis: added - :ref:`max_buffer_size_before_flush ` to batch commands together until the encoder buffer hits a certain size, and - :ref:`buffer_flush_timeout ` to control how quickly the buffer is flushed if it is not full. -* redis: added auth support :ref:`downstream_auth_password ` for downstream client authentication, and :ref:`auth_password ` to configure authentication passwords for upstream server clusters. -* retry: added a retry predicate that :ref:`rejects canary hosts. ` -* router: add support for configuring a :ref:`gRPC timeout offset ` on incoming requests. -* router: added ability to control retry back-off intervals via :ref:`retry policy `. -* router: added ability to issue a hedged retry in response to a per try timeout via a :ref:`hedge policy `. -* router: added a route name field to each http route in route.Route list -* router: added several new variables for exposing information about the downstream TLS connection via :ref:`header - formatters `. -* router: per try timeouts will no longer start before the downstream request has been received in full by the router.This ensures that the per try timeout does not account for slow downstreams and that will not start before the global timeout. -* router: added :ref:`RouteAction's auto_host_rewrite_header ` to allow upstream host header substitution with some other header's value -* router: added support for UPSTREAM_REMOTE_ADDRESS :ref:`header formatter - `. -* router: add ability to reject a request that includes invalid values for - headers configured in :ref:`strict_check_headers ` -* runtime: added support for :ref:`flexible layering configuration - `. -* runtime: added support for statically :ref:`specifying the runtime in the bootstrap configuration - `. -* runtime: :ref:`Runtime Discovery Service (RTDS) ` support added to layered runtime configuration. -* sandbox: added :ref:`CSRF sandbox `. -* server: ``--define manual_stamp=manual_stamp`` was added to allow server stamping outside of binary rules. - more info in the `bazel docs `_. -* server: added :ref:`server state ` statistic. -* server: added :ref:`initialization_time_ms` statistic. -* subset: added :ref:`list_as_any` option to - the subset lb which allows matching metadata against any of the values in a list value - on the endpoints. -* tools: added :repo:`proto ` support for :ref:`router check tool ` tests. -* tracing: add trace sampling configuration to the route, to override the route level. -* upstream: added :ref:`upstream_cx_pool_overflow ` for the connection pool circuit breaker. -* upstream: an EDS management server can now force removal of a host that is still passing active - health checking by first marking the host as failed via EDS health check and subsequently removing - it in a future update. This is a mechanism to work around a race condition in which an EDS - implementation may remove a host before it has stopped passing active HC, thus causing the host - to become stranded until a future update. -* upstream: added :ref:`an option ` - that allows ignoring new hosts for the purpose of load balancing calculations until they have - been health checked for the first time. -* upstream: added runtime error checking to prevent setting dns type to STRICT_DNS or LOGICAL_DNS when custom resolver name is specified. -* upstream: added possibility to override fallback_policy per specific selector in :ref:`subset load balancer `. -* upstream: the :ref:`logical DNS cluster ` now - displays the current resolved IP address in admin output instead of 0.0.0.0. - -1.10.0 (Apr 5, 2019) -==================== -* access log: added a new flag for upstream retry count exceeded. -* access log: added a :ref:`gRPC filter ` to allow filtering on gRPC status. -* access log: added a new flag for stream idle timeout. -* access log: added a new field for upstream transport failure reason in :ref:`file access logger` and - :ref:`gRPC access logger` for HTTP access logs. -* access log: added new fields for downstream x509 information (URI sans and subject) to file and gRPC access logger. -* admin: the admin server can now be accessed via HTTP/2 (prior knowledge). -* admin: changed HTTP response status code from 400 to 405 when attempting to GET a POST-only route (such as /quitquitquit). -* buffer: fix vulnerabilities when allocation fails. -* build: releases are built with GCC-7 and linked with LLD. -* build: dev docker images :ref:`have been split ` from tagged images for easier - discoverability in Docker Hub. Additionally, we now build images for point releases. -* config: added support of using google.protobuf.Any in opaque configs for extensions. -* config: logging warnings when deprecated fields are in use. -* config: removed deprecated --v2-config-only from command line config. -* config: removed deprecated_v1 sds_config from :ref:`Bootstrap config `. -* config: removed the deprecated_v1 config option from :ref:`ring hash `. -* config: removed REST_LEGACY as a valid :ref:`ApiType `. -* config: finish cluster warming only when a named response i.e. ClusterLoadAssignment associated to the cluster being warmed comes in the EDS response. This is a behavioural change from the current implementation where warming of cluster completes on missing load assignments also. -* config: use Envoy cpuset size to set the default number or worker threads if :option:`--cpuset-threads` is enabled. -* config: added support for :ref:`initial_fetch_timeout `. The timeout is disabled by default. -* cors: added :ref:`filter_enabled & shadow_enabled RuntimeFractionalPercent flags ` to filter. -* csrf: added :ref:`CSRF filter `. -* ext_authz: added support for buffering request body. -* ext_authz: migrated from v2alpha to v2 and improved docs. -* ext_authz: added a configurable option to make the gRPC service cross-compatible with V2Alpha. Note that this feature is already deprecated. It should be used for a short time, and only when transitioning from alpha to V2 release version. -* ext_authz: migrated from v2alpha to v2 and improved the documentation. -* ext_authz: authorization request and response configuration has been separated into two distinct objects: :ref:`authorization request - ` and :ref:`authorization response - `. In addition, :ref:`client headers - ` and :ref:`upstream headers - ` replaces the previous *allowed_authorization_headers* object. - All the control header lists now support :ref:`string matcher ` instead of standard string. -* fault: added the :ref:`max_active_faults - ` setting, as well as - :ref:`statistics ` for the number of active faults - and the number of faults the overflowed. -* fault: added :ref:`response rate limit - ` fault injection. -* fault: added :ref:`HTTP header fault configuration - ` to the HTTP fault filter. -* governance: extending Envoy deprecation policy from 1 release (0-3 months) to 2 releases (3-6 months). -* health check: expected response codes in http health checks are now :ref:`configurable `. -* http: added new grpc_http1_reverse_bridge filter for converting gRPC requests into HTTP/1.1 requests. -* http: fixed a bug where Content-Length:0 was added to HTTP/1 204 responses. -* http: added :ref:`max request headers size `. The default behaviour is unchanged. -* http: added modifyDecodingBuffer/modifyEncodingBuffer to allow modifying the buffered request/response data. -* http: added encodeComplete/decodeComplete. These are invoked at the end of the stream, after all data has been encoded/decoded respectively. Default implementation is a no-op. -* outlier_detection: added support for :ref:`outlier detection event protobuf-based logging `. -* mysql: added a MySQL proxy filter that is capable of parsing SQL queries over MySQL wire protocol. Refer to :ref:`MySQL proxy` for more details. -* performance: new buffer implementation (disabled by default; to test it, add "--use-libevent-buffers 0" to the command-line arguments when starting Envoy). -* jwt_authn: added :ref:`filter_state_rules ` to allow specifying requirements from filterState by other filters. -* ratelimit: removed deprecated rate limit configuration from bootstrap. -* redis: added :ref:`hashtagging ` to guarantee a given key's upstream. -* redis: added :ref:`latency stats ` for commands. -* redis: added :ref:`success and error stats ` for commands. -* redis: migrate hash function for host selection to `MurmurHash2 `_ from std::hash. MurmurHash2 is compatible with std::hash in GNU libstdc++ 3.4.20 or above. This is typically the case when compiled on Linux and not macOS. -* redis: added :ref:`latency_in_micros ` to specify the redis commands stats time unit in microseconds. -* router: added ability to configure a :ref:`retry policy ` at the - virtual host level. -* router: added reset reason to response body when upstream reset happens. After this change, the response body will be of the form `upstream connect error or disconnect/reset before headers. reset reason:` -* router: added :ref:`rq_reset_after_downstream_response_started ` counter stat to router stats. -* router: added per-route configuration of :ref:`internal redirects `. -* router: removed deprecated route-action level headers_to_add/remove. -* router: made :ref:`max retries header ` take precedence over the number of retries in route and virtual host retry policies. -* router: added support for prefix wildcards in :ref:`virtual host domains` -* stats: added support for histograms in prometheus -* stats: added usedonly flag to prometheus stats to only output metrics which have been - updated at least once. -* stats: added gauges tracking remaining resources before circuit breakers open. -* tap: added new alpha :ref:`HTTP tap filter `. -* tls: enabled TLS 1.3 on the server-side (non-FIPS builds). -* upstream: add hash_function to specify the hash function for :ref:`ring hash` as either xxHash or `murmurHash2 `_. MurmurHash2 is compatible with std::hash in GNU libstdc++ 3.4.20 or above. This is typically the case when compiled on Linux and not macOS. -* upstream: added :ref:`degraded health value` which allows - routing to certain hosts only when there are insufficient healthy hosts available. -* upstream: add cluster factory to allow creating and registering :ref:`custom cluster type`. -* upstream: added a :ref:`circuit breaker ` to limit the number of concurrent connection pools in use. -* tracing: added :ref:`verbose ` to support logging annotations on spans. -* upstream: added support for host weighting and :ref:`locality weighting ` in the :ref:`ring hash load balancer `, and added a :ref:`maximum_ring_size` config parameter to strictly bound the ring size. -* zookeeper: added a ZooKeeper proxy filter that parses ZooKeeper messages (requests/responses/events). - Refer to :ref:`ZooKeeper proxy` for more details. -* upstream: added configuration option to select any host when the fallback policy fails. -* upstream: stopped incrementing upstream_rq_total for HTTP/1 conn pool when request is circuit broken. - -1.9.1 (Apr 2, 2019) -=================== -* http: fixed CVE-2019-9900 by rejecting HTTP/1.x headers with embedded NUL characters. -* http: fixed CVE-2019-9901 by normalizing HTTP paths prior to routing or L7 data plane processing. - This defaults off and is configurable via either HTTP connection manager :ref:`normalize_path - ` - or the :ref:`runtime `. - -1.9.0 (Dec 20, 2018) -==================== -* access log: added a :ref:`JSON logging mode ` to output access logs in JSON format. -* access log: added dynamic metadata to access log messages streamed over gRPC. -* access log: added DOWNSTREAM_CONNECTION_TERMINATION. -* admin: :http:post:`/logging` now responds with 200 while there are no params. -* admin: added support for displaying subject alternate names in :ref:`certs` end point. -* admin: added host weight to the :http:get:`/clusters?format=json` end point response. -* admin: :http:get:`/server_info` now responds with a JSON object instead of a single string. -* admin: :http:get:`/server_info` now exposes what stage of initialization the server is currently in. -* admin: added support for displaying command line options in :http:get:`/server_info` end point. -* circuit-breaker: added cx_open, rq_pending_open, rq_open and rq_retry_open gauges to expose live - state via :ref:`circuit breakers statistics `. -* cluster: set a default of 1s for :ref:`option `. -* config: removed support for the v1 API. -* config: added support for :ref:`rate limiting` discovery request calls. -* cors: added :ref:`invalid/valid stats ` to filter. -* ext-authz: added support for providing per route config - optionally disable the filter and provide context extensions. -* fault: removed integer percentage support. -* grpc-json: added support for :ref:`ignoring query parameters - `. -* health check: added :ref:`logging health check failure events `. -* health check: added ability to set :ref:`authority header value - ` for gRPC health check. -* http: added HTTP/2 WebSocket proxying via :ref:`extended CONNECT `. -* http: added limits to the number and length of header modifications in all fields request_headers_to_add and response_headers_to_add. These limits are very high and should only be used as a last-resort safeguard. -* http: added support for a :ref:`request timeout `. The timeout is disabled by default. -* http: no longer adding whitespace when appending X-Forwarded-For headers. **Warning**: this is not - compatible with 1.7.0 builds prior to `9d3a4eb4ac44be9f0651fcc7f87ad98c538b01ee `_. - See `#3611 `_ for details. -* http: augmented the `sendLocalReply` filter API to accept an optional `GrpcStatus` - value to override the default HTTP to gRPC status mapping. -* http: no longer close the TCP connection when a HTTP/1 request is retried due - to a response with empty body. -* http: added support for more gRPC content-type headers in :ref:`gRPC bridge filter `, like application/grpc+proto. -* listeners: all listener filters are now governed by the :ref:`listener_filters_timeout - ` setting. The hard coded 15s timeout in - the :ref:`TLS inspector listener filter ` is superseded by - this setting. -* listeners: added the ability to match :ref:`FilterChain ` using :ref:`source_type `. -* load balancer: added a `configuration ` option to specify the number of choices made in P2C. -* logging: added missing [ in log prefix. -* mongo_proxy: added :ref:`dynamic metadata `. -* network: removed the reference to `FilterState` in `Connection` in favor of `StreamInfo`. -* rate-limit: added :ref:`configuration ` - to specify whether the `GrpcStatus` status returned should be `RESOURCE_EXHAUSTED` or - `UNAVAILABLE` when a gRPC call is rate limited. -* rate-limit: removed support for the legacy ratelimit service and made the data-plane-api - :ref:`rls.proto ` based implementation default. -* rate-limit: removed the deprecated cluster_name attribute in :ref:`rate limit service configuration `. -* rate-limit: added :ref:`rate_limit_service ` configuration to filters. -* rbac: added dynamic metadata to the network level filter. -* rbac: added support for permission matching by :ref:`requested server name `. -* redis: static cluster configuration is no longer required. Redis proxy will work with clusters - delivered via CDS. -* router: added ability to configure arbitrary :ref:`retriable status codes. ` -* router: added ability to set attempt count in upstream requests, see :ref:`virtual host's include request - attempt count flag `. -* router: added internal :ref:`grpc-retry-on ` policy. -* router: added :ref:`scheme_redirect ` and - :ref:`port_redirect ` to define the respective - scheme and port rewriting RedirectAction. -* router: when :ref:`max_grpc_timeout ` - is set, Envoy will now add or update the grpc-timeout header to reflect Envoy's expected timeout. -* router: per try timeouts now starts when an upstream stream is ready instead of when the request has - been fully decoded by Envoy. -* router: added support for not retrying :ref:`rate limited requests`. Rate limit filter now sets the :ref:`x-envoy-ratelimited` - header so the rate limited requests that may have been retried earlier will not be retried with this change. -* router: added support for enabling upgrades on a :ref:`per-route ` basis. -* router: support configuring a default fraction of mirror traffic via - :ref:`runtime_fraction `. -* sandbox: added :ref:`cors sandbox `. -* server: added `SIGINT` (Ctrl-C) handler to gracefully shutdown Envoy like `SIGTERM`. -* stats: added :ref:`stats_matcher ` to the bootstrap config for granular control of stat instantiation. -* stream: renamed the `RequestInfo` namespace to `StreamInfo` to better match - its behaviour within TCP and HTTP implementations. -* stream: renamed `perRequestState` to `filterState` in `StreamInfo`. -* stream: added `downstreamDirectRemoteAddress` to `StreamInfo`. -* thrift_proxy: introduced thrift rate limiter filter. -* tls: added ssl.curves., ssl.sigalgs. and ssl.versions. to - :ref:`listener metrics ` to track TLS algorithms and versions in use. -* tls: added support for :ref:`client-side session resumption `. -* tls: added support for CRLs in :ref:`trusted_ca `. -* tls: added support for :ref:`multiple server TLS certificates `. -* tls: added support for :ref:`password encrypted private keys `. -* tls: added the ability to build :ref:`BoringSSL FIPS ` using ``--define boringssl=fips`` Bazel option. -* tls: removed support for ECDSA certificates with curves other than P-256. -* tls: removed support for RSA certificates with keys smaller than 2048-bits. -* tracing: added support to the Zipkin tracer for the :ref:`b3 ` single header format. -* tracing: added support for :ref:`Datadog ` tracer. -* upstream: added :ref:`scale_locality_weight` to enable - scaling locality weights by number of hosts removed by subset lb predicates. -* upstream: changed how load calculation for :ref:`priority levels` and :ref:`panic thresholds` interact. As long as normalized total health is 100% panic thresholds are disregarded. -* upstream: changed the default hash for :ref:`ring hash ` from std::hash to `xxHash `_. -* upstream: when using active health checking and STRICT_DNS with several addresses that resolve - to the same hosts, Envoy will now health check each host independently. - -1.8.0 (Oct 4, 2018) -=================== -* access log: added :ref:`response flag filter ` - to filter based on the presence of Envoy response flags. -* access log: added RESPONSE_DURATION and RESPONSE_TX_DURATION. -* access log: added REQUESTED_SERVER_NAME for SNI to tcp_proxy and http -* admin: added :http:get:`/hystrix_event_stream` as an endpoint for monitoring envoy's statistics - through `Hystrix dashboard `_. -* cli: added support for :ref:`component log level ` command line option for configuring log levels of individual components. -* cluster: added :ref:`option ` to merge - health check/weight/metadata updates within the given duration. -* config: regex validation added to limit to a maximum of 1024 characters. -* config: v1 disabled by default. v1 support remains available until October via flipping --v2-config-only=false. -* config: v1 disabled by default. v1 support remains available until October via deprecated flag --allow-deprecated-v1-api. -* config: fixed stat inconsistency between xDS and ADS implementation. :ref:`update_failure ` - stat is incremented in case of network failure and :ref:`update_rejected ` stat is incremented - in case of schema/validation error. -* config: added a stat :ref:`connected_state ` that indicates current connected state of Envoy with - management server. -* ext_authz: added support for configuring additional :ref:`authorization headers ` - to be sent from Envoy to the authorization service. -* fault: added support for fractional percentages in :ref:`FaultDelay ` - and in :ref:`FaultAbort `. -* grpc-json: added support for building HTTP response from - `google.api.HttpBody `_. -* health check: added support for :ref:`custom health check `. -* health check: added support for :ref:`specifying jitter as a percentage `. -* health_check: added support for :ref:`health check event logging `. -* health_check: added :ref:`timestamp ` - to the :ref:`health check event ` definition. -* health_check: added support for specifying :ref:`custom request headers ` - to HTTP health checker requests. -* http: added support for a :ref:`per-stream idle timeout - `. This applies at both :ref:`connection manager - ` - and :ref:`per-route granularity `. The timeout - defaults to 5 minutes; if you have other timeouts (e.g. connection idle timeout, upstream - response per-retry) that are longer than this in duration, you may want to consider setting a - non-default per-stream idle timeout. -* http: added upstream_rq_completed counter for :ref:`total requests completed ` to dynamic HTTP counters. -* http: added downstream_rq_completed counter for :ref:`total requests completed `, including on a :ref:`per-listener basis `. -* http: added generic :ref:`Upgrade support - `. -* http: better handling of HEAD requests. Now sending transfer-encoding: chunked rather than content-length: 0. -* http: fixed missing support for appending to predefined inline headers, e.g. - *authorization*, in features that interact with request and response headers, - e.g. :ref:`request_headers_to_add - `. For example, a - request header *authorization: token1* will appear as *authorization: - token1,token2*, after having :ref:`request_headers_to_add - ` with *authorization: - token2* applied. -* http: response filters not applied to early error paths such as http_parser generated 400s. -* http: restrictions added to reject *:*-prefixed pseudo-headers in :ref:`custom - request headers `. -* http: :ref:`hpack_table_size ` now controls - dynamic table size of both: encoder and decoder. -* http: added support for removing request headers using :ref:`request_headers_to_remove - `. -* http: added support for a :ref:`delayed close timeout` to mitigate race conditions when closing connections to downstream HTTP clients. The timeout defaults to 1 second. -* jwt-authn filter: add support for per route JWT requirements. -* listeners: added the ability to match :ref:`FilterChain ` using - :ref:`destination_port ` and - :ref:`prefix_ranges `. -* lua: added :ref:`connection() ` wrapper and *ssl()* API. -* lua: added :ref:`streamInfo() ` wrapper and *protocol()* API. -* lua: added :ref:`streamInfo():dynamicMetadata() ` API. -* network: introduced :ref:`sni_cluster ` network filter that forwards connections to the - upstream cluster specified by the SNI value presented by the client during a TLS handshake. -* proxy_protocol: added support for HAProxy Proxy Protocol v2 (AF_INET/AF_INET6 only). -* ratelimit: added support for :repo:`api/envoy/service/ratelimit/v2/rls.proto`. - Lyft's reference implementation of the `ratelimit `_ service also supports the data-plane-api proto as of v1.1.0. - Envoy can use either proto to send client requests to a ratelimit server with the use of the - `use_data_plane_proto` boolean flag in the ratelimit configuration. - Support for the legacy proto `source/common/ratelimit/ratelimit.proto` is deprecated and will be removed at the start of the 1.9.0 release cycle. -* ratelimit: added :ref:`failure_mode_deny ` option to control traffic flow in - case of rate limit service error. -* rbac config: added a :ref:`principal_name ` field and - removed the old `name` field to give more flexibility for matching certificate identity. -* rbac network filter: a :ref:`role-based access control network filter ` has been added. -* rest-api: added ability to set the :ref:`request timeout ` for REST API requests. -* route checker: added v2 config support and removed support for v1 configs. -* router: added ability to set request/response headers at the :ref:`envoy_api_msg_route.Route` level. -* stats: added :ref:`option to configure the DogStatsD metric name prefix` to DogStatsdSink. -* tcp_proxy: added support for :ref:`weighted clusters `. -* thrift_proxy: introduced thrift routing, moved configuration to correct location -* thrift_proxy: introduced thrift configurable decoder filters -* tls: implemented :ref:`Secret Discovery Service `. -* tracing: added support for configuration of :ref:`tracing sampling - `. -* upstream: added configuration option to the subset load balancer to take locality weights into account when - selecting a host from a subset. -* upstream: require opt-in to use the :ref:`x-envoy-original-dst-host ` header - for overriding destination address when using the :ref:`Original Destination ` - load balancing policy. - -1.7.0 (Jun 21, 2018) -==================== -* access log: added ability to log response trailers. -* access log: added ability to format START_TIME. -* access log: added DYNAMIC_METADATA :ref:`access log formatter `. -* access log: added :ref:`HeaderFilter ` - to filter logs based on request headers. -* access log: added `%([1-9])?f` as one of START_TIME specifiers to render subseconds. -* access log: gRPC Access Log Service (ALS) support added for :ref:`HTTP access logs - `. -* access log: improved WebSocket logging. -* admin: added :http:get:`/config_dump` for dumping the current configuration and associated xDS - version information (if applicable). -* admin: added :http:get:`/clusters?format=json` for outputing a JSON-serialized proto detailing - the current status of all clusters. -* admin: added :http:get:`/stats/prometheus` as an alternative endpoint for getting stats in prometheus format. -* admin: added :ref:`/runtime_modify endpoint ` to add or change runtime values. -* admin: mutations must be sent as POSTs, rather than GETs. Mutations include: - :http:post:`/cpuprofiler`, :http:post:`/healthcheck/fail`, :http:post:`/healthcheck/ok`, - :http:post:`/logging`, :http:post:`/quitquitquit`, :http:post:`/reset_counters`, - :http:post:`/runtime_modify?key1=value1&key2=value2&keyN=valueN`. -* admin: removed `/routes` endpoint; route configs can now be found at the :ref:`/config_dump endpoint `. -* buffer filter: the buffer filter can be optionally - :ref:`disabled ` or - :ref:`overridden ` with - route-local configuration. -* cli: added --config-yaml flag to the Envoy binary. When set its value is interpreted as a yaml - representation of the bootstrap config and overrides --config-path. -* cluster: added :ref:`option ` - to close tcp_proxy upstream connections when health checks fail. -* cluster: added :ref:`option ` to drain - connections from hosts after they are removed from service discovery, regardless of health status. -* cluster: fixed bug preventing the deletion of all endpoints in a priority -* debug: added symbolized stack traces (where supported) -* ext-authz filter: added support to raw HTTP authorization. -* ext-authz filter: added support to gRPC responses to carry HTTP attributes. -* grpc: support added for the full set of :ref:`Google gRPC call credentials - `. -* gzip filter: added :ref:`stats ` to the filter. -* gzip filter: sending *accept-encoding* header as *identity* no longer compresses the payload. -* health check: added ability to set :ref:`additional HTTP headers - ` for HTTP health check. -* health check: added support for EDS delivered :ref:`endpoint health status - `. -* health check: added interval overrides for health state transitions from :ref:`healthy to unhealthy - `, :ref:`unhealthy to healthy - ` and for subsequent checks on - :ref:`unhealthy hosts `. -* health check: added support for :ref:`custom health check `. -* health check: health check connections can now be configured to use http/2. -* health check http filter: added - :ref:`generic header matching ` - to trigger health check response. Deprecated the endpoint option. -* http: filters can now optionally support - :ref:`virtual host `, - :ref:`route `, and - :ref:`weighted cluster ` - local configuration. -* http: added the ability to pass DNS type Subject Alternative Names of the client certificate in the - :ref:`config_http_conn_man_headers_x-forwarded-client-cert` header. -* http: local responses to gRPC requests are now sent as trailers-only gRPC responses instead of plain HTTP responses. - Notably the HTTP response code is always "200" in this case, and the gRPC error code is carried in "grpc-status" - header, optionally accompanied with a text message in "grpc-message" header. -* http: added support for :ref:`via header - ` - append. -* http: added a :ref:`configuration option - ` - to elide *x-forwarded-for* header modifications. -* http: fixed a bug in inline headers where addCopy and addViaMove didn't add header values when - encountering inline headers with multiple instances. -* listeners: added :ref:`tcp_fast_open_queue_length ` option. -* listeners: added the ability to match :ref:`FilterChain ` using - :ref:`application_protocols ` - (e.g. ALPN for TLS protocol). -* listeners: `sni_domains` has been deprecated/renamed to :ref:`server_names `. -* listeners: removed restriction on all filter chains having identical filters. -* load balancer: added :ref:`weighted round robin - ` support. The round robin - scheduler now respects endpoint weights and also has improved fidelity across - picks. -* load balancer: :ref:`locality weighted load balancing - ` is now supported. -* load balancer: ability to configure zone aware load balancer settings :ref:`through the API - `. -* load balancer: the :ref:`weighted least request - ` load balancing algorithm has been improved - to have better balance when operating in weighted mode. -* logger: added the ability to optionally set the log format via the :option:`--log-format` option. -* logger: all :ref:`logging levels ` can be configured - at run-time: trace debug info warning error critical. -* rbac http filter: a :ref:`role-based access control http filter ` has been added. -* router: the behavior of per-try timeouts have changed in the case where a portion of the response has - already been proxied downstream when the timeout occurs. Previously, the response would be reset - leading to either an HTTP/2 reset or an HTTP/1 closed connection and a partial response. Now, the - timeout will be ignored and the response will continue to proxy up to the global request timeout. -* router: changed the behavior of :ref:`source IP routing ` - to ignore the source port. -* router: added an :ref:`prefix_match ` match type - to explicitly match based on the prefix of a header value. -* router: added an :ref:`suffix_match ` match type - to explicitly match based on the suffix of a header value. -* router: added an :ref:`present_match ` match type - to explicitly match based on a header's presence. -* router: added an :ref:`invert_match ` config option - which supports inverting all other match types to match based on headers which are not a desired value. -* router: allow :ref:`cookie routing ` to - generate session cookies. -* router: added START_TIME as one of supported variables in :ref:`header - formatters `. -* router: added a :ref:`max_grpc_timeout ` - config option to specify the maximum allowable value for timeouts decoded from gRPC header field - `grpc-timeout`. -* router: added a :ref:`configuration option - ` to disable *x-envoy-* - header generation. -* router: added 'unavailable' to the retriable gRPC status codes that can be specified - through :ref:`x-envoy-retry-grpc-on `. -* sockets: added :ref:`tap transport socket extension ` to support - recording plain text traffic and PCAP generation. -* sockets: added `IP_FREEBIND` socket option support for :ref:`listeners - ` and upstream connections via - :ref:`cluster manager wide - ` and - :ref:`cluster specific ` options. -* sockets: added `IP_TRANSPARENT` socket option support for :ref:`listeners - `. -* sockets: added `SO_KEEPALIVE` socket option for upstream connections - :ref:`per cluster `. -* stats: added support for histograms. -* stats: added :ref:`option to configure the statsd prefix`. -* stats: updated stats sink interface to flush through a single call. -* tls: added support for - :ref:`verify_certificate_spki `. -* tls: added support for multiple - :ref:`verify_certificate_hash ` - values. -* tls: added support for using - :ref:`verify_certificate_spki ` - and :ref:`verify_certificate_hash ` - without :ref:`trusted_ca `. -* tls: added support for allowing expired certificates with - :ref:`allow_expired_certificate `. -* tls: added support for :ref:`renegotiation ` - when acting as a client. -* tls: removed support for legacy SHA-2 CBC cipher suites. -* tracing: the sampling decision is now delegated to the tracers, allowing the tracer to decide when and if - to use it. For example, if the :ref:`x-b3-sampled ` header - is supplied with the client request, its value will override any sampling decision made by the Envoy proxy. -* websocket: support configuring idle_timeout and max_connect_attempts. -* upstream: added support for host override for a request in :ref:`Original destination host request header `. -* header to metadata: added :ref:`HTTP Header to Metadata filter`. - -1.6.0 (March 20, 2018) -====================== - -* access log: added DOWNSTREAM_REMOTE_ADDRESS, DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT, and - DOWNSTREAM_LOCAL_ADDRESS :ref:`access log formatters `. - DOWNSTREAM_ADDRESS access log formatter has been deprecated. -* access log: added less than or equal (LE) :ref:`comparison filter - `. -* access log: added configuration to :ref:`runtime filter - ` to set default sampling rate, divisor, - and whether to use independent randomness or not. -* admin: added :ref:`/runtime ` admin endpoint to read the - current runtime values. -* build: added support for :repo:`building Envoy with exported symbols - `. This change allows scripts loaded with the Lua filter to - load shared object libraries such as those installed via `LuaRocks `_. -* config: added support for sending error details as - `grpc.rpc.Status `_ - in :ref:`DiscoveryRequest `. -* config: added support for :ref:`inline delivery ` of TLS - certificates and private keys. -* config: added restrictions for the backing :ref:`config sources ` - of xDS resources. For filesystem based xDS the file must exist at configuration time. For cluster - based xDS the backing cluster must be statically defined and be of non-EDS type. -* grpc: the Google gRPC C++ library client is now supported as specified in the :ref:`gRPC services - overview ` and :ref:`GrpcService `. -* grpc-json: added support for :ref:`inline descriptors - `. -* health check: added :ref:`gRPC health check ` - based on `grpc.health.v1.Health `_ - service. -* health check: added ability to set :ref:`host header value - ` for http health check. -* health check: extended the health check filter to support computation of the health check response - based on the :ref:`percentage of healthy servers in upstream clusters - `. -* health check: added setting for :ref:`no-traffic - interval`. -* http: added idle timeout for :ref:`upstream http connections - `. -* http: added support for :ref:`proxying 100-Continue responses - `. -* http: added the ability to pass a URL encoded PEM encoded peer certificate in the - :ref:`config_http_conn_man_headers_x-forwarded-client-cert` header. -* http: added support for trusting additional hops in the - :ref:`config_http_conn_man_headers_x-forwarded-for` request header. -* http: added support for :ref:`incoming HTTP/1.0 - `. -* hot restart: added SIGTERM propagation to children to :ref:`hot-restarter.py - `, which enables using it as a parent of containers. -* ip tagging: added :ref:`HTTP IP Tagging filter`. -* listeners: added support for :ref:`listening for both IPv4 and IPv6 - ` when binding to ::. -* listeners: added support for listening on :ref:`UNIX domain sockets - `. -* listeners: added support for :ref:`abstract unix domain sockets ` on - Linux. The abstract namespace can be used by prepending '@' to a socket path. -* load balancer: added cluster configuration for :ref:`healthy panic threshold - ` percentage. -* load balancer: added :ref:`Maglev ` consistent hash - load balancer. -* load balancer: added support for - :ref:`LocalityLbEndpoints` priorities. -* lua: added headers :ref:`replace() ` API. -* lua: extended to support :ref:`metadata object ` API. -* redis: added local `PING` support to the :ref:`Redis filter `. -* redis: added `GEORADIUS_RO` and `GEORADIUSBYMEMBER_RO` to the :ref:`Redis command splitter - ` whitelist. -* router: added DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT, DOWNSTREAM_LOCAL_ADDRESS, - DOWNSTREAM_LOCAL_ADDRESS_WITHOUT_PORT, PROTOCOL, and UPSTREAM_METADATA :ref:`header - formatters `. The CLIENT_IP header formatter - has been deprecated. -* router: added gateway-error :ref:`retry-on ` policy. -* router: added support for route matching based on :ref:`URL query string parameters - `. -* router: added support for more granular weighted cluster routing by allowing the :ref:`total_weight - ` to be specified in configuration. -* router: added support for :ref:`custom request/response headers - ` with mixed static and dynamic values. -* router: added support for :ref:`direct responses `. - I.e., sending a preconfigured HTTP response without proxying anywhere. -* router: added support for :ref:`HTTPS redirects - ` on specific routes. -* router: added support for :ref:`prefix_rewrite - ` for redirects. -* router: added support for :ref:`stripping the query string - ` for redirects. -* router: added support for downstream request/upstream response - :ref:`header manipulation ` in :ref:`weighted - cluster `. -* router: added support for :ref:`range based header matching - ` for request routing. -* squash: added support for the :ref:`Squash microservices debugger `. - Allows debugging an incoming request to a microservice in the mesh. -* stats: added metrics service API implementation. -* stats: added native :ref:`DogStatsd ` support. -* stats: added support for :ref:`fixed stats tag values - ` which will be added to all metrics. -* tcp proxy: added support for specifying a :ref:`metadata matcher - ` for upstream - clusters in the tcp filter. -* tcp proxy: improved TCP proxy to correctly proxy TCP half-close. -* tcp proxy: added :ref:`idle timeout - `. -* tcp proxy: access logs now bring an IP address without a port when using DOWNSTREAM_ADDRESS. - Use :ref:`DOWNSTREAM_REMOTE_ADDRESS ` instead. -* tracing: added support for dynamically loading an :ref:`OpenTracing tracer - `. -* tracing: when using the Zipkin tracer, it is now possible for clients to specify the sampling - decision (using the :ref:`x-b3-sampled ` header) and - have the decision propagated through to subsequently invoked services. -* tracing: when using the Zipkin tracer, it is no longer necessary to propagate the - :ref:`x-ot-span-context ` header. - See more on trace context propagation :ref:`here `. -* transport sockets: added transport socket interface to allow custom implementations of transport - sockets. A transport socket provides read and write logic with buffer encryption and decryption - (if applicable). The existing TLS implementation has been refactored with the interface. -* upstream: added support for specifying an :ref:`alternate stats name - ` while emitting stats for clusters. -* Many small bug fixes and performance improvements not listed. - -1.5.0 (December 4, 2017) -======================== - -* access log: added fields for :ref:`UPSTREAM_LOCAL_ADDRESS and DOWNSTREAM_ADDRESS - `. -* admin: added :ref:`JSON output ` for stats admin endpoint. -* admin: added basic :ref:`Prometheus output ` for stats admin - endpoint. Histograms are not currently output. -* admin: added ``version_info`` to the :ref:`/clusters admin endpoint`. -* config: the :ref:`v2 API ` is now considered production ready. -* config: added --v2-config-only CLI flag. -* cors: added :ref:`CORS filter `. -* health check: added :ref:`x-envoy-immediate-health-check-fail - ` header support. -* health check: added :ref:`reuse_connection ` option. -* http: added :ref:`per-listener stats `. -* http: end-to-end HTTP flow control is now complete across both connections, streams, and filters. -* load balancer: added :ref:`subset load balancer `. -* load balancer: added ring size and hash :ref:`configuration options - `. This used to be configurable via runtime. The runtime - configuration was deleted without deprecation as we are fairly certain no one is using it. -* log: added the ability to optionally log to a file instead of stderr via the - :option:`--log-path` option. -* listeners: added :ref:`drain_type ` option. -* lua: added experimental :ref:`Lua filter `. -* mongo filter: added :ref:`fault injection `. -* mongo filter: added :ref:`"drain close" ` support. -* outlier detection: added :ref:`HTTP gateway failure type `. - See :ref:`deprecated log ` - for outlier detection stats deprecations in this release. -* redis: the :ref:`redis proxy filter ` is now considered - production ready. -* redis: added :ref:`"drain close" ` functionality. -* router: added :ref:`x-envoy-overloaded ` support. -* router: added :ref:`regex ` route matching. -* router: added :ref:`custom request headers ` - for upstream requests. -* router: added :ref:`downstream IP hashing - ` for HTTP ketama routing. -* router: added :ref:`cookie hashing `. -* router: added :ref:`start_child_span ` option - to create child span for egress calls. -* router: added optional :ref:`upstream logs `. -* router: added complete :ref:`custom append/override/remove support - ` of request/response headers. -* router: added support to :ref:`specify response code during redirect - `. -* router: added :ref:`configuration ` - to return either a 404 or 503 if the upstream cluster does not exist. -* runtime: added :ref:`comment capability `. -* server: change default log level (:option:`-l`) to `info`. -* stats: maximum stat/name sizes and maximum number of stats are now variable via the - `--max-obj-name-len` and `--max-stats` options. -* tcp proxy: added :ref:`access logging `. -* tcp proxy: added :ref:`configurable connect retries - `. -* tcp proxy: enable use of :ref:`outlier detector `. -* tls: added :ref:`SNI support `. -* tls: added support for specifying :ref:`TLS session ticket keys - `. -* tls: allow configuration of the :ref:`min - ` and :ref:`max - ` TLS protocol versions. -* tracing: added :ref:`custom trace span decorators `. -* Many small bug fixes and performance improvements not listed. - -1.4.0 (August 24, 2017) -======================= - -* macOS is :repo:`now supported `. (A few features - are missing such as hot restart and original destination routing). -* YAML is now directly supported for config files. -* Added /routes admin endpoint. -* End-to-end flow control is now supported for TCP proxy, HTTP/1, and HTTP/2. HTTP flow control - that includes filter buffering is incomplete and will be implemented in 1.5.0. -* Log verbosity :repo:`compile time flag ` added. -* Hot restart :repo:`compile time flag ` added. -* Original destination :ref:`cluster ` - and :ref:`load balancer ` added. -* :ref:`WebSocket ` is now supported. -* Virtual cluster priorities have been hard removed without deprecation as we are reasonably sure - no one is using this feature. -* Route `validate_clusters` option added. -* :ref:`x-envoy-downstream-service-node ` - header added. -* :ref:`x-forwarded-client-cert ` header - added. -* Initial HTTP/1 forward proxy support for absolute URLs has been added. -* HTTP/2 codec settings are now configurable. -* gRPC/JSON transcoder :ref:`filter ` added. -* gRPC web :ref:`filter ` added. -* Configurable timeout for the rate limit service call in the :ref:`network - ` and :ref:`HTTP ` rate limit - filters. -* :ref:`x-envoy-retry-grpc-on ` header added. -* :ref:`LDS API ` added. -* TLS :`require_client_certificate` option added. -* :ref:`Configuration check tool ` added. -* :ref:`JSON schema check tool ` added. -* Config validation mode added via the :option:`--mode` option. -* :option:`--local-address-ip-version` option added. -* IPv6 support is now complete. -* UDP `statsd_ip_address` option added. -* Per-cluster DNS resolvers added. -* :ref:`Fault filter ` enhancements and fixes. -* Several features are :ref:`deprecated as of the 1.4.0 release `. They - will be removed at the beginning of the 1.5.0 release cycle. We explicitly call out that the - `HttpFilterConfigFactory` filter API has been deprecated in favor of - `NamedHttpFilterConfigFactory`. -* Many small bug fixes and performance improvements not listed. - -1.3.0 (May 17, 2017) -==================== - -* As of this release, we now have an official :repo:`breaking change policy - `. Note that there are numerous breaking configuration - changes in this release. They are not listed here. Future releases will adhere to the policy and - have clear documentation on deprecations and changes. -* Bazel is now the canonical build system (replacing CMake). There have been a huge number of - changes to the development/build/test flow. See :repo:`/bazel/README.md` and - :repo:`/ci/README.md` for more information. -* :ref:`Outlier detection ` has been expanded to include success - rate variance, and all parameters are now configurable in both runtime and in the JSON - configuration. -* TCP level listener and cluster connections now have configurable receive buffer - limits at which point connection level back pressure is applied. - Full end to end flow control will be available in a future release. -* :ref:`Redis health checking ` has been added as an active - health check type. Full Redis support will be documented/supported in 1.4.0. -* :ref:`TCP health checking ` now supports a - "connect only" mode that only checks if the remote server can be connected to without - writing/reading any data. -* `BoringSSL `_ is now the only supported TLS provider. - The default cipher suites and ECDH curves have been updated with more modern defaults for both - listener and cluster connections. -* The `header value match` rate limit action has been expanded to include an `expect - match` parameter. -* Route level HTTP rate limit configurations now do not inherit the virtual host level - configurations by default. Use `include_vh_rate_limits` to inherit the virtual host - level options if desired. -* HTTP routes can now add request headers on a per route and per virtual host basis via the - :ref:`request_headers_to_add ` option. -* The :ref:`example configurations ` have been refreshed to demonstrate the - latest features. -* `per_try_timeout_ms` can now be configured in - a route's retry policy in addition to via the :ref:`x-envoy-upstream-rq-per-try-timeout-ms - ` HTTP header. -* HTTP virtual host matching now includes support for prefix wildcard domains (e.g., `*.lyft.com`). -* The default for tracing random sampling has been changed to 100% and is still configurable in - :ref:`runtime `. -* HTTP tracing configuration has been extended to allow tags - to be populated from arbitrary HTTP headers. -* The :ref:`HTTP rate limit filter ` can now be applied to internal, - external, or all requests via the `request_type` option. -* :ref:`Listener binding ` now requires specifying an `address` field. This can be - used to bind a listener to both a specific address as well as a port. -* The :ref:`MongoDB filter ` now emits a stat for queries that - do not have `$maxTimeMS` set. -* The :ref:`MongoDB filter ` now emits logs that are fully valid - JSON. -* The CPU profiler output path is now configurable. -* A watchdog system has been added that can kill the server if a deadlock is detected. -* A :ref:`route table checking tool ` has been added that can - be used to test route tables before use. -* We have added an :ref:`example repo ` that shows how to compile/link a custom filter. -* Added additional cluster wide information related to outlier detection to the :ref:`/clusters - admin endpoint `. -* Multiple SANs can now be verified via the `verify_subject_alt_name` setting. - Additionally, URI type SANs can be verified. -* HTTP filters can now be passed opaque configuration specified on a per route basis. -* By default Envoy now has a built in crash handler that will print a back trace. This behavior can - be disabled if desired via the ``--define=signal_trace=disabled`` Bazel option. -* Zipkin has been added as a supported :ref:`tracing provider `. -* Numerous small changes and fixes not listed here. - -1.2.0 (March 7, 2017) -===================== - -* :ref:`Cluster discovery service (CDS) API `. -* :ref:`Outlier detection ` (passive health checking). -* Envoy configuration is now checked against a JSON schema. -* :ref:`Ring hash ` consistent load balancer, as well as HTTP - consistent hash routing based on a policy. -* Vastly :ref:`enhanced global rate limit configuration ` via the HTTP - rate limiting filter. -* HTTP routing to a cluster retrieved from a header. -* Weighted cluster HTTP routing. -* Auto host rewrite during HTTP routing. -* Regex header matching during HTTP routing. -* HTTP access log runtime filter. -* LightStep tracer :ref:`parent/child span association `. -* :ref:`Route discovery service (RDS) API `. -* HTTP router :ref:`x-envoy-upstream-rq-timeout-alt-response header - ` support. -* *use_original_dst* and *bind_to_port* :ref:`listener options ` (useful for - iptables based transparent proxy support). -* TCP proxy filter :ref:`route table support `. -* Configurable stats flush interval. -* Various :ref:`third party library upgrades `, including using BoringSSL as - the default SSL provider. -* No longer maintain closed HTTP/2 streams for priority calculations. Leads to substantial memory - savings for large meshes. -* Numerous small changes and fixes not listed here. - -1.1.0 (November 30, 2016) -========================= - -* Switch from Jannson to RapidJSON for our JSON library (allowing for a configuration schema in - 1.2.0). -* Upgrade :ref:`recommended version ` of various other libraries. -* Configurable DNS refresh rate for DNS service discovery types. -* Upstream circuit breaker configuration can be :ref:`overridden via runtime - `. -* :ref:`Zone aware routing support `. -* Generic header matching routing rule. -* HTTP/2 graceful connection draining (double GOAWAY). -* DynamoDB filter :ref:`per shard statistics ` (pre-release AWS - feature). -* Initial release of the :ref:`fault injection HTTP filter `. -* HTTP :ref:`rate limit filter ` enhancements (note that the - configuration for HTTP rate limiting is going to be overhauled in 1.2.0). -* Added :ref:`refused-stream retry policy `. -* Multiple :ref:`priority queues ` for upstream clusters - (configurable on a per route basis, with separate connection pools, circuit breakers, etc.). -* Added max connection circuit breaking to the :ref:`TCP proxy filter `. -* Added :ref:`CLI ` options for setting the logging file flush interval as well - as the drain/shutdown time during hot restart. -* A very large number of performance enhancements for core HTTP/TCP proxy flows as well as a - few new configuration flags to allow disabling expensive features if they are not needed - (specifically request ID generation and dynamic response code stats). -* Support Mongo 3.2 in the :ref:`Mongo sniffing filter `. -* Lots of other small fixes and enhancements not listed. - -1.0.0 (September 12, 2016) -========================== - -Initial open source release. diff --git a/docs/root/version_history/version_history.rst b/docs/root/version_history/version_history.rst new file mode 100644 index 000000000000..b869b08080e0 --- /dev/null +++ b/docs/root/version_history/version_history.rst @@ -0,0 +1,42 @@ +Version history +--------------- + +.. toctree:: + :titlesonly: + + current + v1.14.1 + v1.14.0 + v1.13.1 + v1.13.0 + v1.12.3 + v1.12.2 + v1.12.1 + v1.12.0 + v1.11.2 + v1.11.1 + v1.11.0 + v1.10.0 + v1.9.1 + v1.9.0 + v1.8.0 + v1.7.0 + v1.6.0 + v1.5.0 + v1.4.0 + v1.3.0 + v1.2.0 + v1.1.0 + v1.0.0 + +.. _deprecated: + +Deprecation Policy +^^^^^^^^^^^^^^^^^^ + +As of release 1.3.0, Envoy will follow a +`Breaking Change Policy `_. + +Features in the deprecated list for each version have been DEPRECATED +and will be removed in the specified release cycle. A logged warning +is expected for each deprecated item that is in deprecation window.