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

Add :remote_address_reader PlugContext option #519

Merged
merged 1 commit into from
Feb 2, 2023
Merged

Add :remote_address_reader PlugContext option #519

merged 1 commit into from
Feb 2, 2023

Conversation

michallepicki
Copy link
Contributor

@michallepicki michallepicki commented Sep 2, 2022

When working on masking user IP from Sentry at work, after scrubbing the IP from headers I noticed that user's IP is also visible under Environment's REMOTE_ADDR. One way to hide/mask the IP I thought about was to have additional plugs before and after PlugContext, to change and re-set the conn.remote_ip value. But I think a better solution would be to make reading of this value configurable.

When working on the patch I noticed the logic on the master branch has changed to read the x-forwarded-for header when present, so I made this the new default remote address reader.

@michallepicki
Copy link
Contributor Author

@mitchellhenke bump

Copy link
Member

@sl0thentr0py sl0thentr0py left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty @michallepicki for the contribution!

@sl0thentr0py sl0thentr0py merged commit b915794 into getsentry:master Feb 2, 2023
@michallepicki michallepicki deleted the configurable-remote-address branch February 2, 2023 16:03
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.

2 participants