Repository navigation
feat: expand audit logging #3125
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6843c2f
feat(audit): add operations and named parameters to existing audit enβ¦
GhassenKefi 025ad14
feat(sharing): log Tables shares to the audit log
GhassenKefi 40bddf7
feat(tables): log table creation, archiving and column deletion to thβ¦
GhassenKefi 504d2e3
feat(views): log view creation and data scope changes to the audit log
GhassenKefi 7cb63f3
feat(contexts): log application lifecycle to the audit log
GhassenKefi e794295
feat(import): log completed imports to the audit log
GhassenKefi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
| /** | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| namespace OCA\Tables\AuditLog; | ||
|
|
||
| /** | ||
| * Operations Tables writes to the admin audit log, in the form `app.entity.action` | ||
| * | ||
| * The values are matched by log consumers (filters, alert rules, SIEM imports), | ||
| * so changing one is a breaking change for them. Case names may be renamed. | ||
| */ | ||
| enum Operation: string { | ||
| case TableCreated = 'tables.table.created'; | ||
| case TableArchived = 'tables.table.archived'; | ||
| case TableUnarchived = 'tables.table.unarchived'; | ||
| case TableDeleted = 'tables.table.deleted'; | ||
| case TableTransferred = 'tables.table.transferred'; | ||
| case ViewCreated = 'tables.view.created'; | ||
| case ViewUpdated = 'tables.view.updated'; | ||
| case ViewDeleted = 'tables.view.deleted'; | ||
| case RowDeleted = 'tables.row.deleted'; | ||
| case ColumnDeleted = 'tables.column.deleted'; | ||
| case ImportCompleted = 'tables.import.completed'; | ||
| case ContextCreated = 'tables.context.created'; | ||
| case ContextUpdated = 'tables.context.updated'; | ||
| case ContextDeleted = 'tables.context.deleted'; | ||
| case ContextTransferred = 'tables.context.transferred'; | ||
| case ShareCreated = 'tables.share.created'; | ||
| case SharePermissionsUpdated = 'tables.share.permissions_updated'; | ||
| case ShareDeleted = 'tables.share.deleted'; | ||
| case FederatedShareReceived = 'tables.federated_share.received'; | ||
| case FederatedSharePermissionsUpdated = 'tables.federated_share.permissions_updated'; | ||
| case LinkShareAuthenticationFailed = 'tables.link_share.authentication_failed'; | ||
|
|
||
| /** | ||
| * Short description of when the operation is logged, used for the documentation | ||
| */ | ||
| public function description(): string { | ||
| return match ($this) { | ||
| self::TableCreated => 'A table was created, from the web interface, the API, occ tables:add or a template', | ||
| self::TableArchived => 'A table was archived for all users it is shared with', | ||
| self::TableUnarchived => 'A table was unarchived', | ||
| self::TableDeleted => 'A table was deleted with its views, rows and shares', | ||
| self::TableTransferred => 'The ownership of a table was transferred to another user', | ||
| self::ViewCreated => 'A view was created on a table', | ||
| self::ViewUpdated => 'The filter, columns or settings of a view were changed, which changes the data people the view is shared with can see', | ||
| self::ViewDeleted => 'A view was deleted with its shares', | ||
| self::RowDeleted => 'A row was deleted', | ||
| self::ColumnDeleted => 'A column was deleted with its values in all rows', | ||
| self::ImportCompleted => 'Rows were imported into a table or view from a spreadsheet, possibly creating columns', | ||
| self::ContextCreated => 'An application was created', | ||
| self::ContextUpdated => 'An application was changed, including tables and views added to or removed from it and changes to their permissions in it, which exposes them to the people the application is shared with', | ||
| self::ContextDeleted => 'An application was deleted with its pages and shares', | ||
| self::ContextTransferred => 'The ownership of an application was transferred to another user', | ||
| self::ShareCreated => 'A table, view or application was shared with a user, group, team, remote user or by public link', | ||
| self::SharePermissionsUpdated => 'The permissions of a share of a table or view were changed', | ||
| self::ShareDeleted => 'A share was deleted, by someone managing the shared node or through the share review', | ||
| self::FederatedShareReceived => 'A table or view was shared with a local user from another server', | ||
| self::FederatedSharePermissionsUpdated => 'The server a table or view was shared from changed the permissions of the share with a local user', | ||
| self::LinkShareAuthenticationFailed => 'A wrong password was entered for a password protected public link share', | ||
| }; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.