-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
[#2691] Track IP addresses associated with User signins #6822
Conversation
a315a9d
to
e5ac312
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good, I think there is still some work to do tho.
Does this work with both IPv4 and IPv6 addresses. I think we also need to consider what we do when a user is closed and anonymised.
How about making this more generic and recording IP on sign ins and sign ups? Could then link the "rate limited signup from" email to the index action with IP already filtered. |
I've now used postgres inet type and added a basic test, so should do, though I don't know much about IPv6 tbh.
Good point. I think the regular purge would have been fine, but also added on-demand purging via
I did think about that, but this is the more immediate problem. To consider in relation to #6931. |
Couple of things left to do, but in order to do so I'll want to squash these commits:
|
@gbp a quick pair of eyes over the fixups would be great before I squash them down to complete the remaining tasks. |
Fixups look good me, feel free to squash and rebase |
97c6d71
to
7e4e89b
Compare
7e4e89b
to
da649df
Compare
If a retention period is configured, create a record associated with the user of the signin and the IP address used to do so. Uses Postgres' inet so that we can handle both IPv4 and IPv6 addresses. Fake ipv6 taken from Faker example [1]. A rake/cron task is provided to purge records older than the retention period. A version of #2691 [1] https://github.com/faker-ruby/faker/blob/a00b4c6388c69fdafb7e12cbacdb6d8a9927fba5/lib/faker/default/internet.rb#L423
A grey alert box [1]. [1] https://getbootstrap.com/2.2.0/components.html#alerts
da649df
to
b1cf0da
Compare
Renders a given user's signins on their user admin page. Adds `Admin::Users::SignInsController#index` to list all recorded signins.
Helps to identify possible misusers.
Record the geolocation country code of the IP at the time of sign in so that it can be used for misuse detection and filtering.
b1cf0da
to
abc113c
Compare
Think this is good to go now 🥳 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Linking to #7592. |
If a retention period is configured, create a record associated with the
user of the signin and the IP address used to do so.
A rake/cron task is provided to purge records older than the retention
period.
A version of #2691
View/search all recorded sign ins:
View a given user's sign ins. Check how many others have signed in with the IP:
Click the IP address to go through to the main listing filtered by that IP (or country, added after screenshot):
Filter by partial IP:
Filter by country: