-
Notifications
You must be signed in to change notification settings - Fork 881
Anonymous users in logs + audit logs #6054
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
Comments
We should not be putting random garbage in audit logs. It is not a requirement at this time to track anonymous failed login attempts beyond IP address. If the audit code won't correctly drop logs without a user UUID, we should fix the audit code so that it will. |
Related to #6108 |
Failed log in attempts are a pretty common thing for enterprise products to capture in audit logs. This is something we did in v1: https://www.enterpriseready.io/features/audit-log/ |
However, it looks like some platforms do not have it: https://gitlab.com/gitlab-org/gitlab/-/issues/233377 |
@bpmct my position is that we should drop audit logs on failed login attempts, with IP address, but we should not be assigning random UUIDs to these attempts as that can confuse auditors into thinking the UUIDs represent actual coder users. We don't want customers calling us up saying, "why didn't I get any audit logs for this user other than just a failed login attempt?" |
@spikecurtis we're not doing that! We adjusted the audit code as you suggested. We still need the concept of an anonymous user (with UUIDs we do track) so we can capture 1) repeated failed logins by complete strangers and 2) users who are joining for the first time and don't have an API Key yet. |
After investigating, we have decided to move forward with the following solution:
We will continue to audit failed login attempts by known users. Closing this ticket. The original ticket for the Github/OIDC fix can be found here. |
Problem
We track failed attempts in audit logs and logs, and to generate diffs we are using random uuids's for anonymous users (see #5925).
The issue for this is that the uuids are not obviously anonymous at first glance, and might cause some misunderstandings if logs are consumed programatically. It would be hard to tell if a uuid was random, or maybe some user that was deleted (hard delete).
Tracking the same anonymous user
The other issue with this is that it does not track the same anonymous user. IP address in logs does do this to an extent, and might be sufficient. We could set a cookie on the user's browser some identifying token that does not expire so all unauthenticated requests have the same tracking ID. That way in the audit logs, it is clear the same browser is making many failed requests. Especially useful if there is a group of users behind a NAT since the IP tracking would not distinguish individual users.
Idea
One idea to ensure that it is clear which UUIDs track anonymous users and have no relations to any data in the database, we could:
Static UUID
We could use a static id (eg
11111111-1111-1111-1111-111111111111
). This is obvious it is not a real UUID.The downside is all anonymous users are the same.
Not completely random uuid
We could manipulate a random UUID. UUID's have various parts to them. The RFC states:
https://www.rfc-editor.org/rfc/rfc4122#section-4.4
Standard parts of a uuid (remember that v4 is the one we use and most of this is completely random)
We could use a different version uuid, as it has the same format. I don't know what version exactly, but we could use a version (like v1) that uses time for many of the bits, and something static for the
Node
part. Meaning any "anonymous user" is essentially tracked to the time they were identified as an anonymous user.Example:
(decode the uuid here to see the time: https://www.uuidtools.com/decode)
Some combination of static and random
Same as above, but more random parts instead of using time.
The text was updated successfully, but these errors were encountered: