Skip to content

tcp_proxy: add support to evaluate downstream info at tunnel setting - #18858

Merged
ggreenway merged 4 commits into
envoyproxy:mainfrom
lambdai:tcpproxyeval
Nov 2, 2021
Merged

ggreenway merged 4 commits into
envoyproxy:mainfrom
lambdai:tcpproxyeval

Conversation

@lambdai

@lambdai lambdai commented Nov 2, 2021

Copy link
Copy Markdown
Contributor

Commit Message:
This allows to generate tcp proxy's upstream CONNECT header values using downstream info.
Examples include modifying the host/:authority headers
Or emulate the proxy protocol via CONNECT as in the test cases.

Use with caution: a RFC in-compliant upstream header can be introduced because stream info may carry arbitrary bytes.

Additional Description:
Risk Level: LOW
Testing:
Docs Changes:
Release Notes:
Fixes #18128

Signed-off-by: Yuchen Dai <[email protected]>

@alyssawilk alyssawilk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice! just one nit, and mind adding this config to one of the tcp proxy integration tests as well?
/wit

Comment thread docs/root/version_history/current.rst Resolved
@lambdai

lambdai commented Nov 2, 2021

Copy link
Copy Markdown
Contributor Author

Nice! just one nit, and mind adding this config to one of the tcp proxy integration tests as well? /wit

Thank you for the review! A integration test is added and header name and value is verified there

@alyssawilk alyssawilk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adding Greg for non-google pass

@ggreenway ggreenway left a comment

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.

LGTM

@ggreenway
ggreenway enabled auto-merge (squash) November 2, 2021 19:12
@lambdai

lambdai commented Nov 2, 2021

Copy link
Copy Markdown
Contributor Author

Thank you!
/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Check envoy-presubmit isn't fully completed, but will still attempt retrying.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #18858 (comment) was created by @lambdai.

see: more, trace.

@lambdai

lambdai commented Nov 2, 2021

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #18858 (comment) was created by @lambdai.

see: more, trace.

@lambdai

lambdai commented Nov 2, 2021

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #18858 (comment) was created by @lambdai.

see: more, trace.

@ggreenway
ggreenway merged commit c069715 into envoyproxy:main Nov 2, 2021
@lambdai
lambdai deleted the tcpproxyeval branch November 2, 2021 23:46
@ramaraochavali

Copy link
Copy Markdown
Contributor

Thank you @lambdai for implementing this

@@ -26,6 +26,10 @@ static_resources:
cluster: "cluster_0"
tunneling_config:
hostname: host.com:443

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@lambdai can we also set this hostname using formatter like %REQUESTED_SERVER_NAME% so that the CONNECT uses SNI as host name? IF not, how can I achieve that with this feature?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

IMO the non-trivial operation should be achieve via the headers_to_add field.

The headers_to_add type is HeaderValueOption. It includes the override option OVERWRITE_IF_EXISTS_OR_ADD and the implementation is on the go

WDTY?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes. But I see this comment which says for host it is not supported

// Neither *:-prefixed* pseudo-headers nor the Host: header can be overridden.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@lambdai WDYT?

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.

support formatter in tcp proxy tunneling setting

4 participants