envoyproxy / gateway

Manages Envoy Proxy as a Standalone or Kubernetes-based Application Gateway
https://gateway.envoyproxy.io
Apache License 2.0
1.55k stars 334 forks source link

feat: add support to enable IP Transparency for TCP via Original Source listener filter #3359

Open aoledk opened 4 months ago

aoledk commented 4 months ago

Description:

With current EG, in order to enable IP Transparency for TCP (not HTTP), Proxy Protocol is the only way, it requires upstream host should support Proxy Protocol too.

I propose to support another option that Envoy has already implemented to enable IP Transparency for TCP: Original Source listener filter. It doesn't require upstream host should support Proxy Protocol, but require appropriate network routing rules.

[optional Relevant Links:]

https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/other_features/ip_transparency https://www.envoyproxy.io/docs/envoy/latest/configuration/listeners/listener_filters/original_src_filter

zufardhiyaulhaq commented 4 months ago

+1, this is enabled in Istio gateway, so we have 2 options to do IP whitelisting

  1. XFF
  2. source IP

@arkodg can we consider this?

arkodg commented 4 months ago

sure this makes sense, we enable this by default if listener protocol is TCP ?

aoledk commented 4 months ago

sure this makes sense, we enable this by default if listener protocol is TCP ?

That should be an opt-in feature for TCP listener, because Envoy requires user to setup appropriate route rules to make Original Source listener filter to work correctly ^1.

zufardhiyaulhaq commented 4 months ago

@arkodg nvm, seems like RBAC remote_ip on Envoy doesn't required this plugin. https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/rbac/v3/rbac.proto#envoy-v3-api-msg-config-rbac-v3-principal

bjlhlin commented 3 months ago

/assign

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days.

davem-git commented 1 week ago

would this be to allow us to filter on source IP?