Title: Anonymous users in logs + audit logs · Issue #6054 · coder/coder · GitHub
Open Graph Title: Anonymous users in logs + audit logs · Issue #6054 · coder/coder
X Title: Anonymous users in logs + audit logs · Issue #6054 · coder/coder
Description: 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...
Open Graph Description: 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 an...
X Description: 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 obviousl...
Opengraph URL: https://github.com/coder/coder/issues/6054
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Anonymous users in logs + audit logs ","articleBody":"# Problem\r\n\r\nWe track failed attempts in audit logs and logs, and to generate diffs we are using random uuids's for anonymous users (see https://github.com/coder/coder/pull/5925). \r\n\r\nThe 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).\r\n\r\n## Tracking the same anonymous user\r\n\r\nThe 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.\r\n\r\n# Idea\r\n\r\nOne idea to ensure that it is clear which UUIDs track anonymous users and have no relations to any data in the database, we could:\r\n\r\n## Static UUID\r\n\r\nWe could use a static id (eg `11111111-1111-1111-1111-111111111111`). This is obvious it is not a real UUID. \r\n\r\nThe downside is all anonymous users are the same.\r\n\r\n## Not completely random uuid\r\n\r\nWe could manipulate a random UUID. UUID's have various parts to them. The RFC states:\r\n\r\nhttps://www.rfc-editor.org/rfc/rfc4122#section-4.4\r\n```\r\n[4.4](https://www.rfc-editor.org/rfc/rfc4122#section-4.4). Algorithms for Creating a UUID from Truly Random or\r\n Pseudo-Random Numbers\r\n\r\n The version 4 UUID is meant for generating UUIDs from truly-random or\r\n pseudo-random numbers.\r\n\r\n The algorithm is as follows:\r\n\r\n o Set the two most significant bits (bits 6 and 7) of the\r\n clock_seq_hi_and_reserved to zero and one, respectively.\r\n\r\n o Set the four most significant bits (bits 12 through 15) of the\r\n time_hi_and_version field to the 4-bit version number from\r\n [Section 4.1.3](https://www.rfc-editor.org/rfc/rfc4122#section-4.1.3).\r\n\r\n o Set all the other bits to randomly (or pseudo-randomly) chosen\r\n values.\r\n```\r\n\r\nStandard parts of a uuid (remember that v4 is the one we use and most of this is completely random)\r\n\r\n\r\n\r\nWe 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.\r\n\r\nExample:\r\n(decode the uuid here to see the time: https://www.uuidtools.com/decode)\r\n```\r\n3cb47c7a-a637-11ed-afa1-aa0000000000\r\n```\r\n\r\n## Some combination of static and random\r\n\r\nSame as above, but more random parts instead of using time.","author":{"url":"https://github.com/Emyrk","@type":"Person","name":"Emyrk"},"datePublished":"2023-02-06T16:02:14Z","url":"https://github.com/coder/coder/issues/6054"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4ad4d575-a666-011a-eae9-be1bdf1d236e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B140:62F48:21F436:2CD8F0:6B01BCBE |
| html-safe-nonce | d614c8ed049bbce2a1e3a6288c9d70fd3bae43d53fe7b5ee680671c08b9c4097 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTQwOjYyRjQ4OjIxRjQzNjoyQ0Q4RjA6NkIwMUJDQkUiLCJ2aXNpdG9yX2lkIjoiNDIyMjE3NTE5NTYzMDI1NTI5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2f7f96e4c2dc55b66e8b9c10f7baed29f8e67fdbb95262e8f02dcbe9bf42fd6a |
| hovercard-subject-tag | issue:1572841136 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/6054/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c233a294107d1f1f01da4aff149452fcccf94d4f4230265aede8c0a0a1e29231/coder/coder/issues/6054 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c233a294107d1f1f01da4aff149452fcccf94d4f4230265aede8c0a0a1e29231/coder/coder/issues/6054 |
| og:image:alt | 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 an... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Emyrk |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width