Skip to content

feat: expand audit logging - #3125

Merged
blizzz merged 6 commits into
mainfrom
feat/admin-audit-logging
Oct 27, 2026
Merged

blizzz merged 6 commits into
mainfrom
feat/admin-audit-logging

Conversation

@GhassenKefi

Copy link
Copy Markdown
Contributor

🖼️ Screenshots

🏚️ Before 🏡 After
B A

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stableX.X
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@GhassenKefi GhassenKefi added enhancement New feature or request 3. to review Waiting for reviews AI assisted labels Oct 19, 2026
@GhassenKefi GhassenKefi self-assigned this Oct 19, 2026
@GhassenKefi
GhassenKefi requested a review from samin-z October 19, 2026 17:21
public function log(string $message, array $context): void {
$auditEvent = new CriticalActionPerformedEvent($message, $context);
public function log(Operation $operation, string $message, array $parameters = []): void {
$auditEvent = new CriticalActionPerformedEvent($message, $parameters, false, $operation->value);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the operation name is passed as a forth argument to CriticalActionPerformedEvent, the argument exists only since NC 36, on 33-35 the constructor takes three arguments, so this causes a break. tables main still runs on those versions.

@GhassenKefi
GhassenKefi force-pushed the feat/admin-audit-logging branch from d5f5dba to eb0194f Compare October 20, 2026 15:46
@GhassenKefi
GhassenKefi requested a review from samin-z October 20, 2026 16:36
@blizzz
blizzz force-pushed the feat/admin-audit-logging branch from eb0194f to 21a895a Compare October 23, 2026 11:20

@blizzz blizzz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank for the PR! Please consider my comments inline.

Comment thread lib/Service/Support/DefaultAuditLogService.php
Comment thread lib/AuditLog/Operation.php
Comment thread lib/Service/ShareService.php
Comment thread lib/Controller/PublicSharePageController.php
Comment thread lib/Service/ImportService.php
Comment thread lib/Service/ImportService.php Outdated
…tries

The audit log entries for deleted tables, views and rows and for
transferred tables and applications now carry an operation and named
parameters, with the messages unchanged. The operations are collected
in the new OCA\Tables\AuditLog\Operation enum, with a short description
of each for the documentation, and AuditLogServiceInterface::log() now
takes the operation.

The entries only carry IDs and user IDs. The full table, view and row
were passed as parameters before, which put the cell values of deleted
rows into the audit log.

A table transfer now logs the previous owner as fromUserId instead of
the user doing the transfer, which was empty when run through occ. The
application transfer entry now also names the previous owner, and goes
through the audit log service like the other entries.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Creating a share of a table, view or application (with a user, group,
team, remote user or by public link), changing the permissions of a
share and deleting a share are now written to the admin audit log.
Tables shares are not core shares, so admin_audit did not see them.

Deleting a share through the share review skips the manage permission
check and is logged with its own message. Receiving a federated share
from another server and entering a wrong password for a password
protected public link share are logged too, the latter through the
authFailed() hook of AuthPublicShareController. When the sharing server
changes the permissions of a received federated share, the new
permissions are logged as well.

The share token and password are never logged.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
…e audit log

Creating a table (from the web interface, the API, occ tables:add or a
template), archiving and unarchiving it, and deleting a column are now
written to the admin audit log. Deleting a column removes its values
from every row, so it is logged like a deletion.

Columns removed together with their table are not logged separately, as
the table deletion is already logged. Tables imported through the user
migration are the user's own data and are not logged. Other table
updates (title, emoji, description, sorting) are not logged.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Creating a view and changing its filter, columns or view settings are
now written to the admin audit log. These settings decide which rows
and columns the people the view is shared with can see, so the entry
lists which of them changed. Changes to the title, emoji, description,
sorting or layout of a view are not logged.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Creating, updating and deleting an application (context) are now
written to the admin audit log. Adding a table or view to an
application exposes it to everyone the application is shared with, so
the update entry lists the added and removed nodes and the nodes whose
permissions in the application changed, and the create
entry lists the nodes the application starts with. Deleting an
application also deletes its pages and shares.

The name, icon and description of an application are not logged.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Importing rows from a spreadsheet into a table or view is now written
to the admin audit log, for both the current import (including the
background job) and the legacy API endpoints. Only the number of
inserted and updated rows, created columns and errors is logged, never
the imported values. Failed imports are not logged.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
@GhassenKefi
GhassenKefi force-pushed the feat/admin-audit-logging branch from 21a895a to e794295 Compare October 26, 2026 14:11
@GhassenKefi
GhassenKefi requested a review from blizzz October 27, 2026 08:31
@susnux susnux changed the title Feat/admin audit logging feat: expand audit logging Oct 27, 2026
@blizzz
blizzz merged commit 2446cc6 into main Oct 27, 2026
86 checks passed
@blizzz
blizzz deleted the feat/admin-audit-logging branch October 27, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants