-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Extensions: Network filter to forward SNI from the downstream TLS connection to the upstream TLS connection #4334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 113 commits
7166095
8e298cc
fea6a13
2f39451
3cc57db
f90f771
1d8578a
5e7bed7
f8b4f60
26eb6fb
7c37d51
ba9ff7d
35945a4
3f927b1
cfcc5ee
f0c1725
baced96
8f40ece
aae6a12
567552d
09b8738
77de8e7
e7f5948
f7249b2
798a655
97057e9
9f9fbe8
9a2a41e
b44433d
1ed9359
c1d4228
cb4ecb8
7a0fb8b
932d043
320e435
c7a32d0
e9fc3a1
3da1148
8d8b39c
325855f
740bfd3
45aed66
19a6e0d
7e18f1c
233bc5f
5e704fb
af8e96f
460e84a
5bccf5c
6d1ff22
365bf98
d2857ea
4a11d1f
1dbef57
cbf26fa
616c91b
5d9b559
809c74f
f41f7c0
ac4278a
9217a85
7150d92
74bdc7e
d441cda
bfea2ff
123f591
5ab3ad2
e4a44c6
e24ff66
4ea35c7
2590146
50a5091
b53e88a
b748e80
60b04e0
4e7601a
6fd2102
53ee9a5
c890c3b
9e6966a
2667505
13e8101
652c050
b9fd493
ce243f4
0f7d564
fa2df04
4a7c8e6
a96f40f
4fd8156
68e15df
4e5648a
e560b74
1613f42
502f9d3
548c063
c9d3673
45734c0
127bce3
2e4a8da
0c7a948
f01b818
e63a960
7b28148
0dc8998
46dd604
89ce5fc
d44e6f2
c2fada8
25c1aa6
7bb1793
ca99513
6b8ea04
08602ac
7ccaf1d
0f13892
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| .. _config_network_filters_forward_original_sni: | ||
|
|
||
| Forward Original SNI | ||
| ========================= | ||
|
|
||
| The `forward_original_sni` is a network filter that instructs other filters, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. given this explanation, I think this should be called use_downstream_sni .
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rshriram Agreed, Regarding:
So why does the explanation not cover the case you are describing? If we can consider mTLS being a kind of TLS: |
||
| such as `tcp_proxy`, to forward the SNI value from the downstream connection | ||
| to the upstream connection. The filter will do nothing for non-TLS connections or | ||
| for TLS connections without SNI. | ||
|
|
||
| This filter has no configuration. It must be installed before the | ||
| :ref:`tcp_proxy <config_network_filters_tcp_proxy>` filter. | ||
|
|
||
| * :ref:`v2 API reference <envoy_api_field_listener.Filter.name>` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,3 +20,4 @@ filters. | |
| tcp_proxy_filter | ||
| thrift_proxy_filter | ||
| sni_cluster_filter | ||
| forward_original_sni | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,15 @@ envoy_cc_library( | |
| ], | ||
| ) | ||
|
|
||
| envoy_cc_library( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be under tcp_proxy, see what is done for PerConnectionCluster, also this should be named override_server_name, "forward" what the filter does and this key only intended for override.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My intention was as follows: So there are three different names here:
This is why I put Forward Requested Server Name in the stream info and not in TCP proxy, to make this artifact independent from the TCP proxy. |
||
| name = "forward_requested_server_name_lib", | ||
| srcs = ["forward_requested_server_name.cc"], | ||
| hdrs = ["forward_requested_server_name.h"], | ||
| deps = [ | ||
| "//include/envoy/stream_info:filter_state_interface", | ||
| ], | ||
| ) | ||
|
|
||
| envoy_cc_library( | ||
| name = "utility_lib", | ||
| srcs = ["utility.cc"], | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #include "common/stream_info/forward_requested_server_name.h" | ||
|
|
||
| namespace Envoy { | ||
| namespace StreamInfo { | ||
|
|
||
| const std::string ForwardRequestedServerName::Key = | ||
| "envoy.stream_info.forward_requested_server_name"; | ||
|
|
||
| } // namespace StreamInfo | ||
| } // namespace Envoy |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #pragma once | ||
|
|
||
| #include "envoy/stream_info/filter_state.h" | ||
|
|
||
| #include "absl/strings/string_view.h" | ||
|
|
||
| namespace Envoy { | ||
| namespace StreamInfo { | ||
|
|
||
| /** | ||
| * Original Requested Server Name | ||
| */ | ||
| class ForwardRequestedServerName : public FilterState::Object { | ||
| public: | ||
| ForwardRequestedServerName(absl::string_view server_name) : server_name_(server_name) {} | ||
| const std::string& value() const { return server_name_; } | ||
| static const std::string Key; | ||
|
|
||
| private: | ||
| const std::string server_name_; | ||
| }; | ||
|
|
||
| } // namespace StreamInfo | ||
| } // namespace Envoy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name yourself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lizan Sure, let me extract the non-extension part into a separate PR, I am in favor of separate PRs.