-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add CONFIG parameter that stores the REAL_IP of the client #8867
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide. |
I'm good to take this and implement, if approved of course |
I don't think this is needed; see what I ended up doing with the
At least one of these should always be defined by the HTTP frontend, so I think this is a reasonable approach. It's also worth pointing out that this challenge (reliably determining the client IP address) is a very generic "Django problem" rather than something specific to NetBox. I'm happy to defer to whatever is considered best practice by the Django community. |
@jeremystretch I think you should leave the option for the admin to choose what http header stores the real ip |
That can easily be handled within the HTTP frontend configuration. |
I'm going to close this out as it doesn't appear to be needed. Happy to revisit this if we receive actionable feedback for #8233 in the v3.3 release. |
I was actually thinking of this one today... |
NetBox version
v3.1.9
Feature type
New functionality
Proposed functionality
The real IP of a client is currently unknown to netbox. All traffic goes through a reverse proxy (nginx), hiding the original client IP.
We have to create a configurable paramters that identified the HTTP Header that stores the original IP. This is required because not all of the reverse proxies use the same HTTP Header (X-Forwarded-For, X-Real-IP, ...)
This FR will add a new configuration parameter that customizes the HTTP header that stores the real IP of the client.
Proposed Configuration variable name : PROXY_HEADER_REALIP
PROXY_HEADER_REALIP
Default: HTTP_X_REAL_IP
This parameters sets the HTTP Header that contains the REAL IP of a client that connects through a PROXY. The Real IP is required to validate an API token's Allowed IPRanges.
Other common values are HTTP_X_FORWARDED_FOR, HTTP_X_CLIENT_IP
Use case
The FR '#8233 Restrict API key usage by source IP' requires to see the real IP address.
For now a static HTTP Header of 'HTTP_X_REAL_IP is used in that FR, but this needs to be customizable
Database changes
No response
External dependencies
No response
The text was updated successfully, but these errors were encountered: