-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Security logs: delete old user security logs #8620
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
Conversation
8c8d945
to
50a9a94
Compare
50a9a94
to
e117e07
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.
Looks good to me! I just want to be sure if we don't want to save audit logs for different periods of time based on the organization's plan the user belongs to.
""" | ||
Delete personal security logs older than `days`. | ||
|
||
If `days` isn't given, default to ``RTD_AUDITLOGS_DEFAULT_RETENTION_DAYS``. |
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.
Shouldn't we keep audit logs longer for users belonging to organizations with bigger plans?
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.
The logs we are deleting are related to actions of the user outside the organization, especially auth and auth failures to the dashboard. This type of information isn't visible to the organization owners currently.
We could show this type of activity to the org owners (just of members of the org), but those are outside the organization, so not sure if that makes sense to show to org owners since it isn't related to activity done on the organization.
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.
I think it's important to keep this data in the database. It could be useful for organization's owners, in particular, if they think they are being attacked and trying to log in with different accounts from their employees to gain access to unauthorized documentation.
Also, if the organization wants to audit when they users logging for the last time or similar, it's data they should have access to.
So, I'd personally tie these retention days to the same day of the plan the organization is paying for.
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.
Yea, I'd be 👍 on using the organization plan here, so users get the benefit of the organization's longer subscription time. I think this makes the most sense.
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.
I have overridden this task on .com, since there is code there that I'm using, but I'll move that code to .org soon. This PR still needs to be merged, it does the deletion for logs from .org where we don't have organizations, the other PR on .com overrides this.
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.
Cool! I think we should have all the code in just one project (here) and check for RTD_ALLOW_ORGANIZATION
to decide what's the logic to run on each case.
Moving to next release. @stsewd looks like this just needs a small update. |
Co-authored-by: Manuel Kaufmann <[email protected]>
dd6b5b8
to
d4ee0cd
Compare
""" | ||
Delete personal security logs older than `days`. | ||
|
||
If `days` isn't given, default to ``RTD_AUDITLOGS_DEFAULT_RETENTION_DAYS``. |
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.
Cool! I think we should have all the code in just one project (here) and check for RTD_ALLOW_ORGANIZATION
to decide what's the logic to run on each case.
Delete all logs that aren't attached to an organization, this is since those logs should be deleted according to their plan on .com.
Logs that aren't attached to an organization are logs from authentication to the dashboard, aka user security logs.