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

Extract peer real IP from Load Balancer when possible #1510

Merged
merged 7 commits into from Jan 31, 2024
Merged

Conversation

surik
Copy link
Contributor

@surik surik commented Jan 30, 2024

Otherwise, get it from the GRPC peer address.

This PR extends management config with a new TrustedHTTPProxies option that accepts a list of network prefixes ex: "192.168.1.1/32", "10.0.0.0/16" that is used for evaluation of client real ip according to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#selecting_an_ip_address

Describe your changes

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

Otherwise get it from GRPC peer address
management/server/grpcserver.go Outdated Show resolved Hide resolved
management/server/grpcserver.go Outdated Show resolved Hide resolved
@surik surik marked this pull request as ready for review January 30, 2024 20:50
@surik surik requested a review from mlsmaycon January 30, 2024 20:50
@surik surik marked this pull request as draft January 31, 2024 10:54
@surik surik marked this pull request as ready for review January 31, 2024 13:05
@surik surik merged commit 93cab49 into main Jan 31, 2024
23 checks passed
@surik surik deleted the yury/realip branch January 31, 2024 15:02
Foosec pushed a commit to Foosec/netbird that referenced this pull request May 8, 2024
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.

None yet

3 participants