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

Switch to X-Real-IP header for IP Extraction #2291

Open
Psykepro opened this issue Jul 17, 2023 · 1 comment
Open

Switch to X-Real-IP header for IP Extraction #2291

Psykepro opened this issue Jul 17, 2023 · 1 comment
Assignees
Milestone

Comments

@Psykepro
Copy link
Contributor

Psykepro commented Jul 17, 2023

Summary:

Once the necessary infrastructure changes are in place, we need to switch from using the X-Forwarded-For HTTP header to using the X-Real-IP HTTP header for retrieving the client's IP address.

Description:

Currently, our JSON RPC system fetches the client's IP address from the X-Forwarded-For HTTP header. This approach has known security risks as the X-Forwarded-For header can be manipulated, which could lead to IP spoofing. We plan to shift to using the X-Real-IP header, which is more secure and reliable, for fetching the client's IP address.

This issue is dependent on updates to our infrastructure that are currently underway. Once those updates are complete, we will be able to make the switch.

Steps:

  1. Update JSON RPC IP Extraction:

    • Modify the relevant JSON RPC methods to fetch the client's IP address from the X-Real-IP HTTP header.
  2. Implement IP Validation:

    • Ensure the IP address fetched from the X-Real-IP header is validated for format correctness and validity.
  3. Talk with Xavi if we need to enforce to have always non-empty and valid IP address in the header. (currently it is not enforced)

Motivation:

Switching to X-Real-IP for IP extraction will enhance our system's security by protecting against IP spoofing attacks. This change is critical to maintaining the integrity of our transaction logs and the overall reliability of our services.

@Psykepro
Copy link
Contributor Author

Follow-up issue related to: #2284

@tclemos tclemos added this to the v0.5.0 milestone Oct 14, 2023
@tclemos tclemos modified the milestones: v0.6.0, v0.5.0 Nov 21, 2023
@tclemos tclemos modified the milestones: v0.5.0, v0.6.0 Feb 5, 2024
@agnusmor agnusmor modified the milestones: v0.6.0, v0.7.0 Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants