Repository navigation
feat: add more verbose audit logging to server apps - #65542
GhassenKefi wants to merge 20 commits into
Conversation
f685ce8 to
aee3d38
Compare
|
Question... What happens when one of these apps is disabled? files_external or files_sharing for instance... Since the classes are unavailable when the app is disabled does this not crash the system? |
Listeners are registered by class string so its not a problem if the class does not exist, as the listener will just never be called |
That works then On a side note I think this approache is unsatainable... I think each app/module should implement its own auditing... like the NC logger... (full transparancy this might already exist I just haven't looked in to it) |
Yes I agree! @GhassenKefi apps should, as discussed, use the All other app related logging should be done with |
aee3d38 to
9492e7b
Compare
|
Saw the most recent push. The CriticalActionPerformedEvent is a better way. This also should probably be implemented for all crud and sharing operations in CalDAV and CardDAV.
|
admin_audit now listens to core events that were dispatched but not audited: - SubAdminAddedEvent / SubAdminRemovedEvent (groups.subadmin.*) - GroupChangedEvent for display name changes - TwoFactorProviderForUserRegistered / Unregistered (auth.twofactor_provider.*) - UserChangedEvent for display name, quota and managers Display name values are not logged, only the fact that they changed. Password changes are now logged for every user backend, not only the database backend, so LDAP password renewals and admin resets of LDAP passwords are audited too. The backend is added as a parameter. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
…nments Updating and deleting system tags is now audited through the existing TagUpdatedEvent and TagDeletedEvent. Changing the groups that may assign a restricted tag dispatches no event, so SystemTagManager dispatches a CriticalActionPerformedEvent there. Assigning and unassigning is only logged for restricted and invisible tags, as those are the ones access control and retention rules rely on. Ordinary user tags are not logged. Each entry carries the number of objects and at most ten object IDs, so bulk assignments stay a single short entry. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Requesting, accepting and rejecting an ownership transfer, and the transfer itself, are now written to the audit log. The transfer entry is dispatched by OwnershipTransferService, so it covers the background job and occ files:transfer-ownership. Rejecting by dismissing the notification is logged as well. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
- Accepting a share and leaving it are logged through the existing ShareAcceptedEvent and ShareDeletedFromSelfEvent. - Restoring a deleted share is logged by DeletedShareAPIController. - Share20\Manager::updateShare logs changes to the download restriction and share attributes, and a changed link token. The token itself is never logged. - Accepting, declining and removing an incoming federated share is logged by the external share manager. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
…dit entries The existing audit entries of the legacy OCS endpoints now carry an operation (federatedfilesharing.share.*) and named parameters, with the messages unchanged. Revoking a reshare is logged as well. Shares and notifications arriving through the generic OCM endpoints are logged by cloud_federation_api, so nothing is logged twice. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
…ations Shares and notifications received on the OCM endpoints are now audited for every resource type (files, calendars, Talk, ...), after the provider has accepted them. The shared secret of a notification is not logged. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Creating, updating and deleting external storages is now audited in StoragesService, so admin and personal storages are covered for the web UI and occ. Saving global or per-user credentials is logged by the controllers. Backend options and credentials are never logged. The existing Storage*Event classes are not public API and turn a mount point change into a delete and a create, so they are not used for this. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Enabling and disabling the recovery key, changing its password, changing a user's recovery setting, recovering a user's files, regenerating a user's keys after an admin password reset, changing the private key password and toggling home storage encryption are now audited. Passwords and keys are never logged. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Adding and removing a trusted server and exchanging a shared secret with it are now written to the audit log by the federation app through CriticalActionPerformedEvent. The shared secret is never logged. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
9492e7b to
d09c987
Compare
|
@SebastianKrupinski This 2 were already implemented
i added this in my last push
you can find them all in this commit as for
it was deliberately not logged, because every sync client produces them constantly. so it would flood the audit log. |
A sync client should only retrieve data, it should not create, update or delete unless a user strictly preforms an action, in calendar or contacts. I don't think these actions would cause a lot of audit log spam. At the minimum we should log deletes. |
A new dav listener writes calendar and address book creation, trashing, deletion, restore, publishing and share changes to the audit log through CriticalActionPerformedEvent, based on the existing dav events. The public link of a published calendar is not logged. Calendar export, accepting and declining federated calendars, creating direct download links and enabling or disabling birthday calendars are logged where they happen. Direct link tokens are never logged. Granting and revoking calendar delegation (read or write access to all calendars of a user, set through the calendar-proxy-read and calendar-proxy-write principals) is logged once per delegate whose access actually changed. Setting the same access again is not logged. Events and contacts created, updated, deleted, moved to the trash, restored or moved to another calendar or address book are logged with the object URI, never their content. The birthday calendar and the system address book are skipped, as the server generates them from contacts and user accounts; subscribed calendars dispatch separate events and are not logged either. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Audit entries are added for app password creation, deletion and scope changes, remote wipe requests, WebAuthn devices, two-factor enforcement, mail server settings and credentials, admin delegation, presets, declarative settings and log file downloads. The existing AI settings entry keeps its message and now carries an operation (settings.ai.updated) and named parameters. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
…ounts Setting and deleting app config values through the API is now audited, with the app and key only, since app config can hold secrets. Remote wipe of a user's devices, resending the welcome email and edits of another user's account are logged too. For account edits only the field name is logged, and fields already audited by core are skipped. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
ClientService now audits adding and removing OAuth2 clients, which covers the admin settings and occ. The client secret is never logged. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Generating backup codes, which replaces any previous codes, is now audited. The codes are never logged. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Creating, updating, copying and deleting LDAP configurations through the API, revealing the bind password and clearing user or group mappings are now audited. For updates only the names of the changed keys are logged, never their values. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Creating, updating and deleting flow rules is now audited in the manager, for both admin and user scope. Check values are not logged. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Creating, updating and deleting webhooks is now audited. Only the origin of the target URI is logged, since webhook URIs often contain secrets in their path or query. Headers and auth data are never logged. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Changing, resetting and uploading theming settings and images through the web UI is now audited. Only the setting name is logged. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Changing the update channel and creating a web updater token are now audited. The token is never logged. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Removing an app from the app store is now audited, next to the existing enable, disable and update entries. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
d09c987 to
0d1b6e8
Compare
|
@SebastianKrupinski event and contact create, update and delete are now logged in the same dav commit, with server-generated data (birthday calendar, system address book, subscriptions) excluded. |
Summary
Add audit log entries for actions in The following apps, either by sending CriticalActionPerformedEvent from the app or by having admin_audit listen to existing events.
App Lists :
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)