Skip to content

Conversation

agrawroh
Copy link
Member

@agrawroh agrawroh commented Sep 7, 2025

Description

This PR adds a new terminal network filter which accepts or rejects the incoming reverse connection requests sent from the reverse tunnels downstream connection interface and optionally validating the Node ID and Cluster ID values that come as part of the handshake protocol using the Envoy filter state metadata. Filter state could be populated by other network filters like "Set-Filter State", etc.

This new filter could be configured with the type URL type.googleapis.com/envoy.extensions.filters.network.reverse_tunnel.v3.ReverseTunnel.


Commit Message: filter: added reverse tunnel terminal network filter
Additional Description: Adds a new terminal network filter for accepting the incoming reverse tunnel handshake requests from the downstream instances.
Risk Level: Low
Testing: Added Unit & Integration Tests
Docs Changes: Added
Release Notes: Added

@agrawroh agrawroh force-pushed the reverse-tunnel-filter branch 19 times, most recently from 82b3136 to b588dde Compare September 9, 2025 00:41
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @adisuissa
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #41013 was synchronize by agrawroh.

see: more, trace.

@agrawroh agrawroh changed the title filter: reverse tunnel network filter filter: added reverse tunnel terminal network filter Sep 9, 2025
@agrawroh agrawroh force-pushed the reverse-tunnel-filter branch 5 times, most recently from 718d66b to 54c7927 Compare September 9, 2025 03:04
Copy link

CC @envoyproxy/coverage-shephards: FYI only for changes made to (test/coverage.yaml).
envoyproxy/coverage-shephards assignee is @RyanTheOptimist

🐱

Caused by: #41013 was synchronize by agrawroh.

see: more, trace.

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>
@agrawroh agrawroh force-pushed the reverse-tunnel-filter branch from d004988 to fe267f8 Compare September 19, 2025 00:47
@agrawroh agrawroh marked this pull request as ready for review September 19, 2025 01:10
yanavlasov
yanavlasov previously approved these changes Sep 23, 2025
@yanavlasov
Copy link
Contributor

LGTM from me. Will wait for @adisuissa API review and then submit.

/wait-any

Copy link
Member

@botengyao botengyao left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! LGTM except small comments.

/wait

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>
// Previous filters in the network chain can populate the connection's filter state
// with validation data (e.g., extracted from client certificates or authentication tokens)
// that this filter will use to validate incoming reverse tunnel requests.
message ValidationConfig {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to have some assumptions, which I'm not sure if they are true. Specifically:

  • Will there only be a single node/cluster/tenant_id_filter_state_key?
  • AFAICT each of these defines a filter-state-key that must (although maybe it is only optional) be present in the filter-state, and that the value will match a node_id/cluster_id/tenant_id. Will it make sense that non-exat matching will be desired (e.g., prefix)?
  • It is unclear if these are all required together, or if one is valid then it makes the reverse tunnel connection valid.

More generally will it make sense to add a generic matcher here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the feedback @adisuissa. I think this part need some more consideration. I'll remove the validation piece for now as it's not blocking and will submit it as a follow-up.

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>
Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>
Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

/lgtm api

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>
@agrawroh agrawroh enabled auto-merge (squash) September 24, 2025 00:49
@agrawroh
Copy link
Member Author

@yanavlasov @botengyao Could one of you please re-stamp this?

Copy link
Member

@botengyao botengyao left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@agrawroh agrawroh merged commit 059923f into envoyproxy:main Sep 24, 2025
25 checks passed
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.

6 participants