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

feat:support configuring xff trusted cidrs #4702

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rudrakhp
Copy link
Contributor

What type of PR is this?

feat:support configuring xff trusted cidrs

What this PR does / why we need it:

Implement API introduced in #4500

Which issue(s) this PR fixes:

Refer #4489

Release Notes: No

@rudrakhp rudrakhp requested a review from a team as a code owner November 11, 2024 11:44
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 80.55556% with 7 lines in your changes missing coverage. Please review.

Project coverage is 65.62%. Comparing base (d1a8c47) to head (66d9135).

Files with missing lines Patch % Lines
internal/ir/xds.go 0.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4702      +/-   ##
==========================================
+ Coverage   65.59%   65.62%   +0.02%     
==========================================
  Files         211      211              
  Lines       31999    32034      +35     
==========================================
+ Hits        20990    21022      +32     
- Misses       9765     9768       +3     
  Partials     1244     1244              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arkodg
Copy link
Contributor

arkodg commented Nov 14, 2024

hey @rudrakhp can we add an e2e for this in this PR, or can you confirm this works by testing manually (and e2e can be added in a follow up)

@rudrakhp rudrakhp force-pushed the xff_trusted_cidrs_feat branch 2 times, most recently from c145161 to 52831e6 Compare November 14, 2024 12:34
@rudrakhp
Copy link
Contributor Author

rudrakhp commented Nov 14, 2024

@arkodg I tried to use original IP detection extension's xff_num_trusted_hops instead of the same param in the parent HCM filter (which is on deprecation path according to envoy community). But looks like it's breaking RBAC somehow (this e2e was failing). Started a thread envoyproxy/envoy#37140 to understand this further.
Meanwhile only using xff_trusted_cidrs in the new extension to ensure no change in NumTrustedHops behaviour. Just an FYI in case we might decide to use the extension for NumTrustedHops as well in the future which will require us to fix this.
I will add E2E for trusted CIDRs in this PR to ensure functionality.

@rudrakhp rudrakhp force-pushed the xff_trusted_cidrs_feat branch 12 times, most recently from 1fde45a to 5595e7d Compare November 24, 2024 10:38
@zhaohuabing
Copy link
Member

zhaohuabing commented Nov 25, 2024

@arkodg I tried to use original IP detection extension's xff_num_trusted_hops instead of the same param in the parent HCM filter (which is on deprecation path according to envoy community). But looks like it's breaking RBAC somehow (this e2e was failing). Started a thread envoyproxy/envoy#37140 to understand this further. Meanwhile only using xff_trusted_cidrs in the new extension to ensure no change in NumTrustedHops behaviour. Just an FYI in case we might decide to use the extension for NumTrustedHops as well in the future which will require us to fix this. I will add E2E for trusted CIDRs in this PR to ensure functionality.

@rudrakhp This is probably related to envoyproxy/envoy#34241

@rudrakhp rudrakhp force-pushed the xff_trusted_cidrs_feat branch 10 times, most recently from 5154988 to 5c96805 Compare December 1, 2024 13:26
@rudrakhp
Copy link
Contributor Author

rudrakhp commented Dec 1, 2024

According to HCM docs:

Extensions cannot be used in conjunction with use_remote_address nor xff_num_trusted_hops.

But due to known issues mentioned earlier, not able to move legacy num trusted hops to the new extension. Moving PR to draft till the envoy issue is resolved.

@rudrakhp rudrakhp marked this pull request as draft December 1, 2024 21:24
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.

3 participants