Skip to content

SNI-based dynamic forward proxy filter#10448

Merged
mattklein123 merged 22 commits intoenvoyproxy:masterfrom
lizan:sni_dynamic_forward_proxy
Apr 16, 2020
Merged

SNI-based dynamic forward proxy filter#10448
mattklein123 merged 22 commits intoenvoyproxy:masterfrom
lizan:sni_dynamic_forward_proxy

Conversation

@lizan
Copy link
Copy Markdown
Member

@lizan lizan commented Mar 19, 2020

Signed-off-by: Lizan Zhou lizan@tetrate.io

Description:
Implement a network filter to do DNS resolution based on SNI. So a TCP connection can be routed to a dynamic_forward_proxy cluster based on that.

Risk Level: Low (extension only)
Testing: manual, unit test, integration test.
Docs Changes: protodoc
Release Notes: Added
Fixes #9916

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #10448 was opened by lizan.

see: more, trace.

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API review..

lizan added 3 commits March 20, 2020 00:03
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
…rd_proxy

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@junr03
Copy link
Copy Markdown
Member

junr03 commented Mar 20, 2020

Thanks for the API review @htuch. @lizan I have been in meetings all day today, I'll get a first review up by monday :)

Comment thread docs/root/intro/version_history.rst Outdated
Copy link
Copy Markdown
Member

@junr03 junr03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass of comments!

Comment thread docs/root/intro/version_history.rst Outdated
Comment thread source/extensions/filters/network/sni_dynamic_forward_proxy/BUILD Outdated
Comment thread source/extensions/filters/network/sni_dynamic_forward_proxy/BUILD
Comment thread source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc Outdated
@junr03
Copy link
Copy Markdown
Member

junr03 commented Mar 26, 2020

/wait

lizan added 2 commits March 27, 2020 21:37
…rd_proxy

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
lizan added 4 commits March 27, 2020 23:36
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@htuch
Copy link
Copy Markdown
Member

htuch commented Mar 30, 2020

/lgtm api

Copy link
Copy Markdown
Member

@junr03 junr03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly lgtm assigning to @mattklein123 so he can take a pass.

lizan added 2 commits March 31, 2020 22:22
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
…rd_proxy

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks this is super cool. Just a few small comments.

/wait

[(validate.rules).message = {required: true}];

oneof port_specifier {
// The port number to connect to the upstream.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this flexible enough? Might we need different ports for different hosts at some point? Is that why you did the oneof?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's the reason we have oneof here as pointed out by @htuch. SNI itself dosn't contain port number but we can support original dst port etc.

Comment thread source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc Outdated
Comment thread source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc Outdated
@htuch
Copy link
Copy Markdown
Member

htuch commented Apr 7, 2020

Please merge master to pick up #10672. We no longer accept changes to v2 (without explicit exception), so any API modifications should happen in v3. If this PR is adding a new proto, please follow the updated instructions in https://github.com/envoyproxy/envoy/blob/master/api/STYLE.md#adding-an-extension-configuration-to-the-api.

@stale
Copy link
Copy Markdown

stale Bot commented Apr 14, 2020

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale Bot added the stale stalebot believes this issue/PR has not been touched recently label Apr 14, 2020
lizan added 6 commits April 15, 2020 00:59
…rd_proxy

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
…rd_proxy

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
…rd_proxy

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@stale stale Bot removed the stale stalebot believes this issue/PR has not been touched recently label Apr 15, 2020
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks LGTM with 1 question. Can you also merge master?

/wait

return Network::FilterStatus::Continue;
}

// TODO(lizan): implement circuit breaker in SNI dynamic forward proxy like it is in HTTP:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an reason not to do this now since it's pretty easy? Or can this be done as an immediate follow up? This is going to get used and this is a pretty big potential issue I think?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike HTTP in network filters we don't have immediate access to cluster info through filter callbacks. There are plumbings need to happen there.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK sounds good.

…rd_proxy

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic forward proxy support for TLS traffic

5 participants