Add Organizational event logging feature #1932

Closed
opened 2026-04-06 02:39:43 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @BlackDex on 10/26/2022

This PR adds event/audit logging support for organizations.
By default this feature is disabled, since it does log a lot and adds
extra database transactions.

All events are touched except a few, since we do not support those
features (yet), like SSO for example.

This feature is tested with multiple clients and all database types.

Fixes #229


Checklist:

User ✔️
  • UserLoggedIn
  • UserChangedPassword
  • UserUpdated2fa
  • UserDisabled2fa
  • UserRecovered2fa
  • UserFailedLogIn
  • UserFailedLogIn2fa
  • UserClientExportedVault
  • UserUpdatedTempPassword
  • UserMigratedKeyToKeyConnector
Cipher ✔️
  • CipherCreated
  • CipherUpdated
  • CipherDeleted
  • CipherAttachmentCreated
  • CipherAttachmentDeleted
  • CipherShared
  • CipherUpdatedCollections
  • CipherClientViewed
  • CipherClientToggledPasswordVisible
  • CipherClientToggledHiddenFieldVisible
  • CipherClientToggledCardCodeVisible
  • CipherClientCopiedPassword
  • CipherClientCopiedHiddenField
  • CipherClientCopiedCardCode
  • CipherClientAutofilled
  • CipherSoftDeleted
  • CipherRestored
  • CipherClientToggledCardNumberVisible
Collection ✔️
  • CollectionCreated
  • CollectionUpdated
  • CollectionDeleted
Group ✔️
  • GroupCreated
  • GroupUpdated
  • GroupDeleted
Org User ✔️
  • OrganizationUserInvited
  • OrganizationUserConfirmed
  • OrganizationUserUpdated
  • OrganizationUserRemoved
  • OrganizationUserUpdatedGroups
  • OrganizationUserUnlinkedSso
  • OrganizationUserResetPasswordEnroll
  • OrganizationUserResetPasswordWithdraw
  • OrganizationUserAdminResetPassword
  • OrganizationUserResetSsoLink
  • OrganizationUserFirstSsoLogin
  • OrganizationUserRevoked
  • OrganizationUserRestored
Organization ✔️
  • OrganizationUpdated
  • OrganizationPurgedVault
  • OrganizationClientExportedVault
  • OrganizationVaultAccessed
  • OrganizationEnabledSso
  • OrganizationDisabledSso
  • OrganizationEnabledKeyConnector
  • OrganizationDisabledKeyConnector
  • OrganizationSponsorshipsSynced
  • PolicyUpdated

Misc:

  • Log Admin Interface user update/delete actions.
  • Config option to enable/disable this feature
  • Test MySQL and PostgreSQL
  • Cronjob to clean event logs with a retention of x days
  • Test all event types and links the web-vault generate
  • Test other clients, Desktop, Mobile, etc..
  • Use the continuation token and load a max of 30 items a time?
*Originally created by @BlackDex on 10/26/2022* This PR adds event/audit logging support for organizations. By default this feature is disabled, since it does log a lot and adds extra database transactions. All events are touched except a few, since we do not support those features (yet), like SSO for example. This feature is tested with multiple clients and all database types. Fixes #229 --- **Checklist:** <details><summary>User :heavy_check_mark:</summary> - [x] UserLoggedIn - [x] UserChangedPassword - [x] UserUpdated2fa - [x] UserDisabled2fa - [x] UserRecovered2fa - [x] UserFailedLogIn - [x] UserFailedLogIn2fa - [x] UserClientExportedVault - ~~UserUpdatedTempPassword~~ - ~~UserMigratedKeyToKeyConnector~~ </details> <details><summary>Cipher :heavy_check_mark:</summary> - [x] CipherCreated - [x] CipherUpdated - [x] CipherDeleted - [x] CipherAttachmentCreated - [x] CipherAttachmentDeleted - [x] CipherShared - [x] CipherUpdatedCollections - [x] CipherClientViewed - [x] CipherClientToggledPasswordVisible - [x] CipherClientToggledHiddenFieldVisible - [x] CipherClientToggledCardCodeVisible - [x] CipherClientCopiedPassword - [x] CipherClientCopiedHiddenField - [x] CipherClientCopiedCardCode - [x] CipherClientAutofilled - [x] CipherSoftDeleted - [x] CipherRestored - [x] CipherClientToggledCardNumberVisible </details> <details><summary>Collection :heavy_check_mark:</summary> - [x] CollectionCreated - [x] CollectionUpdated - [x] CollectionDeleted </details> <details><summary>Group :heavy_check_mark:</summary> - [x] GroupCreated - [x] GroupUpdated - [x] GroupDeleted </details> <details><summary>Org User :heavy_check_mark:</summary> - [x] OrganizationUserInvited - [x] OrganizationUserConfirmed - [x] OrganizationUserUpdated - [x] OrganizationUserRemoved - [x] OrganizationUserUpdatedGroups - ~~OrganizationUserUnlinkedSso~~ - ~~OrganizationUserResetPasswordEnroll~~ - ~~OrganizationUserResetPasswordWithdraw~~ - ~~OrganizationUserAdminResetPassword~~ - ~~OrganizationUserResetSsoLink~~ - ~~OrganizationUserFirstSsoLogin~~ - [x] OrganizationUserRevoked - [x] OrganizationUserRestored </details> <details><summary>Organization :heavy_check_mark:</summary> - [x] OrganizationUpdated - [x] OrganizationPurgedVault - [x] OrganizationClientExportedVault - ~~OrganizationVaultAccessed~~ - ~~OrganizationEnabledSso~~ - ~~OrganizationDisabledSso~~ - ~~OrganizationEnabledKeyConnector~~ - ~~OrganizationDisabledKeyConnector~~ - ~~OrganizationSponsorshipsSynced~~ - [x] PolicyUpdated </details> **Misc:** - [x] Log Admin Interface user update/delete actions. - [x] Config option to enable/disable this feature - [x] Test MySQL and PostgreSQL - [x] Cronjob to clean event logs with a retention of x days - [x] Test all event types and links the web-vault generate - [x] Test other clients, Desktop, Mobile, etc.. - [x] Use the continuation token and load a max of 30 items a time?
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#1932