Skip to content
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

filterChainMatch: add support for source IPs and ports #4457

Closed
junr03 opened this issue Sep 18, 2018 · 22 comments · Fixed by #7064
Closed

filterChainMatch: add support for source IPs and ports #4457

junr03 opened this issue Sep 18, 2018 · 22 comments · Fixed by #7064
Assignees
Labels
api/v2 beginner Good starter issues! help wanted Needs help!
Milestone

Comments

@junr03
Copy link
Member

junr03 commented Sep 18, 2018

filterChainMatch: add support for source IPs and ports

Description:
There exist fields for this type of matching in the FilterHeadMatch proto already, they just have not been implemented. The implementation should be straightforward, as it should be very similar to the destination implementation.

As far as ordering @PiotrSikora and I were chatting, and believe that this should be added as the last matching criteria.

the idea behind putting it last is that then you still can do fancy selection of the destination, based on what’s available now and then do “horizon split” if you want to treat some clients differently.

Relevant to this issue is the fact that v1 tcp proxy filter supports source port and ips based routing, and in order for a v2 tcp proxy filter to support the same expressiveness we need the filter match criteria to support source based matching.

@junr03 junr03 added help wanted Needs help! api/v2 beginner Good starter issues! labels Sep 18, 2018
@junr03
Copy link
Member Author

junr03 commented Sep 18, 2018

Will leave unassigned for now. I'll try and get something from the team at Lyft to work on this, but if a member of the OSS community wants to work on this I am happy to help.

@cmluciano
Copy link
Member

cmluciano commented Sep 19, 2018

@junr03 Not sure if you found anyone for this yet, but I'm testing a commit locally for this now. Will push up if tests pass.

@junr03
Copy link
Member Author

junr03 commented Sep 19, 2018

@cmluciano fantastic! Please tag me on the PR once it is up, and I can review. Mind if I assign you the issue?

@cmluciano
Copy link
Member

SGTM @junr03

@junr03
Copy link
Member Author

junr03 commented Oct 16, 2018

@PiotrSikora I failed to update this issue with a question that I had, and @cmluciano just reminded me of it. In the original V1 tcp proxy config both source and destination ports allowed for multiple ports https://www.envoyproxy.io/docs/envoy/latest/api-v1/network_filters/tcp_proxy_filter#route.

However, the filter change match proto has repeated field for destination ports but a single uint32 for the source port. Was this intended?

@PiotrSikora
Copy link
Contributor

That's more of a question to @htuch, who authored the proto, but it looks that the single destination_port was driven by use_original_dst (see: envoyproxy/data-plane-api#143), while the repeated source_ports were driven by the capabilities of v1 tcp proxy (see: envoyproxy/data-plane-api#49).

Do we have any users of v1 tcp proxy that use multiple ports?

@cmluciano
Copy link
Member

I can potentially create a new field that is just source_port & mark the source_ports for deprecation if that works.

@htuch
Copy link
Member

htuch commented Oct 16, 2018

@cmluciano is there a good reason for this API churn? @PiotrSikora is correct about how this came to be in the v2 API, but I'm not sure there is much benefit from turning this back to a singleton.

@PiotrSikora
Copy link
Contributor

@htuch I guess this is more about unwanted asymmetry between similar features, i.e. perhaps adding repeated destination_ports (and eventually deprecating singleton destination_port) would be a way to go about this?

@htuch
Copy link
Member

htuch commented Oct 17, 2018

@PiotrSikora sure. You can actually safely upgrade a singleton to repeated without breaking wire compatibility.

@PiotrSikora
Copy link
Contributor

@htuch but then we have repeated destination_port, which doesn't follow API conventions.

@htuch
Copy link
Member

htuch commented Oct 17, 2018

@PiotrSikora I don't mind that much. Nobody is using these features right now, so unless there is a compelling case to make it more complicated, just make them singletons.

@cmluciano
Copy link
Member

cmluciano commented Oct 18, 2018

just make them singletons

@htuch To confirm, are you saying it's ok for me to drop repeated from the source_ports?

Also should we rename it to be source_port or perhaps create that as a new field and mark source_ports for deprecation?

@htuch
Copy link
Member

htuch commented Oct 18, 2018

@cmluciano I guess what I want to know now is why we care about source port at all? Is anyone using this feature?

@cmluciano
Copy link
Member

@htuch Ah! I suppose that IS the question. I'll await more answers here / followup on #4682 before continuing

@stale
Copy link

stale bot commented Nov 17, 2018

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Nov 17, 2018
@mattklein123 mattklein123 added this to the 1.9.0 milestone Nov 18, 2018
@stale stale bot removed the stale stalebot believes this issue/PR has not been touched recently label Nov 18, 2018
@mattklein123
Copy link
Member

I think source IP is in progress?

@cmluciano
Copy link
Member

/unassign @cmluciano

Unfortunately I'm not sure if anyone still has a use for this issue. unassigning myself in case anyone wants to clean up the PR I had started before.

@htuch
Copy link
Member

htuch commented Apr 12, 2019

@cmluciano don't we need this to get rid of the TCP proxy v1 field?

@cmluciano
Copy link
Member

Ah somehow I missed the attached issue with the deprecated line. I've been trying to get UDP plumbed through the upstream pieces of the codebase, but I can table that if this is higher priority.

@htuch
Copy link
Member

htuch commented Apr 12, 2019

Yep, I think we need to do this reasonably soon, CC @alyssawilk

@mattklein123 mattklein123 self-assigned this May 14, 2019
@mattklein123
Copy link
Member

I will implement this in the next few days.

mattklein123 pushed a commit that referenced this issue May 24, 2019
This PR also fully deprecates the tcp_proxy v1 configuration.
This will be deleted following the standard deprecation cycle.
All new uses should use filter chain matching.

Fixes #4457

Signed-off-by: Matt Klein <mklein@lyft.com>
mattklein123 added a commit that referenced this issue May 31, 2019
This PR also fully deprecates the tcp_proxy v1 configuration.
This will be deleted following the standard deprecation cycle.
All new uses should use filter chain matching.

Fixes #4457

Signed-off-by: Matt Klein <mklein@lyft.com>
mattklein123 pushed a commit to envoyproxy/data-plane-api that referenced this issue May 31, 2019
This PR also fully deprecates the tcp_proxy v1 configuration.
This will be deleted following the standard deprecation cycle.
All new uses should use filter chain matching.

Fixes envoyproxy/envoy#4457

Signed-off-by: Matt Klein <mklein@lyft.com>

Mirrored from https://github.com/envoyproxy/envoy @ 866d0438d12ce9d39afb35ba200b0107bf3d6de3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api/v2 beginner Good starter issues! help wanted Needs help!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants