Auditing
Introduction
The Auditing app is an Enterprise only app and available on the marketplace. It traces user and admin actions, in particular the following events:
-
Login and logout events of users
-
File system operations (create / delete / move; including actions on the trash bin and versioning)
-
Sharing operations (user / group sharing, sharing via link, changing permissions, calls to sharing API from clients)
-
Custom Groups events
-
File tagging operations (add / remove tags)
-
File commenting operations (create / update / delete)
-
User management operations (creation / deletion / activation / deactivation of users, group management)
-
User settings changes
-
Impersonation events
-
Enabling / disabling of ownCloud Apps
-
Executions of OCC commands (CLI)
You may also want to check out the ownCloud App for Splunk. For more information, read this section. |
Installation and Enabling
Download the Auditing app from the marketplace and enable it in the ownCloud app settings.
Configuration
It is advised to redirect messages into a separate file. To do so, add these lines to config.php
and adjust the target path accordingly. Otherwise make sure to adjust the server log level to 1 (or 0), or else the Auditing app won’t log anything. Configuring a separate file circumvents the global log level. Note that the target path must be writable for the web server user:
'log.conditions' => [
[
'apps' => ['admin_audit'],
'logfile' => '/var/www/owncloud/data/admin_audit.log'
]
]
All messages regardless of log level will be logged there. |
To ignore all CLI triggered events (default is to include them), set the following option:
sudo -u www-data ./occ config:app:set admin_audit ignore_cli_events --value='yes'
Grouped Logging
With each log message, a number of users are calculated to be the 'audit context'. This is the list of users which are related to the log message. Additionally, each log message includes a list of groups that the users are a member of, to enable filtering / splitting of the log messages at a later date. In cases when users are members of many groups, to reduce the data output, the group list can be filtered by adding the following to your config.php
. Change the groups needed accordingly:
'admin_audit.groups' => [
'group1',
'group2'
]
When the filter is configured, only the filtered list of groups will be output in auditGroups, else, all groups that the auditUsers are a member of are output.
View and Download Logs
If you have configured a different logfile than the default, you must download it manually. |
To download your logfile on your admin page. Click data/owncloud.log
.
See Logging Configuration and File Tagging for more information on logging and tagging. |
Connect with Splunk Cloud
Install the Universal Forwarder
Connect to the deployment server, change input-prd-your-server-here
according your setup:
splunk set deploy-poll input-prd-your-server-here.cloud.splunk.com:8089
Install the Splunk Cloud credentials
splunk install app path/to/splunkclouduf.spl -auth admin:changeme
Monitor the admin_audit.log
To Monitor the ownCloud Splunk audit log, add this to inputs.conf
, assuming you use the custom logging path/file from above:
[monitor://var/www/owncloud/data/admin_audit.log]
disabled = false
sourcetype = _json
index = main
Finally, configure the following props.conf
to ensure the time field is correctly used and the fields are extracted.
[_json]
INDEXED_EXTRACTIONS = json
KV_MODE = json
TIMESTAMP_FIELDS = [Time]
category = Structured
Extra Fields
The audit app listens for internal ownCloud events and hooks and produces a rich set of audit entries useful for reporting on usage of your ownCloud server.
Log entries are based upon the internal ownCloud logging system, but utilise extra fields to hold relevant data fields related to the specific event. Each event will contain the following data at a minimum:
Key | Type | Description |
---|---|---|
|
string |
The remote client IP |
|
string |
The UID of the user performing the action, |
|
string |
The process request URI |
|
string |
The HTTP request method |
|
string |
The HTTP request user agent |
|
string |
The time of the event e.g.: |
|
string |
Always |
|
string |
Sentence explaining the action |
|
string |
Unique action identifier e.g.: |
|
boolean |
If the action was performed from the CLI |
|
integer |
The log level of the entry (usually |
Output
Files
file_create
When a file is created.
Key | Type | Description |
---|---|---|
|
string |
The full path to the create file |
|
string |
The UID of the owner of the file |
|
string |
The newly created files identifier |
file_read
When a file is read.
Key | Type | Description |
---|---|---|
|
string |
The full path to the file |
|
string |
The UID of the owner of the file |
|
string |
The files identifier |
file_update
Key | Type | Description |
---|---|---|
|
string |
The full path to the updated file |
|
string |
The UID of the owner of the file |
|
string |
The updated files identifier |
file_delete
Key | Type | Description |
---|---|---|
|
string |
The full path to the updated file |
|
string |
The UID of the owner of the file |
|
string |
The updated files identifier |
file_copy
Key | Type | Description |
---|---|---|
|
string |
The full path to the source file |
|
string |
The full path to the new file |
|
string |
The UID of the owner of the source file |
|
string |
The UID of the owner of the file |
|
string |
The source files identifier |
|
string |
The new files identifier |
file_rename
Key | Type | Description |
---|---|---|
|
string |
The original path file |
|
string |
The new path file |
|
string |
The files identifier |
file_trash_delete
Key | Type | Description |
---|---|---|
|
string |
The UID of the owner of the file |
|
string |
The full path to the deleted file |
file_trash_restore
Key | Type | Description |
---|---|---|
|
string |
The UID of the owner of the file |
|
string |
The restored files identifier |
|
string |
The original path to the file |
|
string |
The new path to the file |
|
string |
The UID of the owner of the file |
Users
group_member_added
Key | Type | Description |
---|---|---|
|
string |
The UID of the user |
|
string |
The GID of the group |
group_member_removed
Key | Type | Description |
---|---|---|
|
string |
The UID of the user |
|
string |
The GID of the group |
Sharing
Sharing events come with a default set of fields
Key | Type | Description |
---|---|---|
|
string |
The file identifier for the item shared |
|
string |
The UID of the owner of the shared item |
|
string |
The path to the shared item |
|
string |
The sharing identifier |
file_shared
Key | Type | Description |
---|---|---|
|
string |
|
|
string |
The text expiration date in format |
|
boolean |
If the share is password protected |
|
string |
The permissions string e.g.: "READ" |
|
string |
|
|
string |
The UID or GID of the share recipient |
|
string |
The UID of the share owner |
|
string |
For link shares the |
file_unshared
Key | Type | Description |
---|---|---|
|
string |
|
|
string |
|
|
string |
The UID or GID of the share recipient |
share_permission_update
Key | Type | Description |
---|---|---|
|
string |
|
|
string |
|
|
string |
The UID of the share owner |
|
string |
The new permissions string e.g.: "READ" |
|
string |
The UID or GID of the share recipient |
|
string |
The old permissions string e.g.: "READ" |
share_name_updated
Key | Type | Description |
---|---|---|
|
string |
The previous share name |
|
string |
The updated share name |
share_password_updated
Key | Type | Description |
---|---|---|
|
string |
|
|
string |
The UID of the share owner |
|
string |
The full permissions string e.g.: "READ" |
|
string |
The share token |
|
boolean |
If the share is password protected |
share_expiration_date_updated
Key | Type | Description |
---|---|---|
|
string |
|
|
string |
|
|
string |
The UID of the owner of the share |
|
string |
The permissions string e.g.: "READ" |
|
string |
The new text expiration date in format |
|
string |
The old text expiration date in format |
share_accepted
Key | Type | Description |
---|---|---|
|
string |
|
|
string |
The path of the shared item |
|
string |
The UID of the owner of the shared item |
|
string |
The file identifier for the item shared |
|
string |
The sharing identifier (not available for public_link_accessed) |
|
string |
|
share_declined
Key | Type | Description |
---|---|---|
|
string |
|
|
string |
The path of the shared item |
|
string |
The UID of the owner of the shared item |
|
string |
The file identifier for the item shared |
|
string |
The sharing identifier (not available for public_link_accessed) |
|
string |
|
federated_share_received
Key | Type | Description |
---|---|---|
|
string |
The path of shared item |
|
string |
The target user who sent the item |
|
string |
|
federated_share_accepted
Key | Type | Description |
---|---|---|
|
string |
The path of shared item |
|
string |
The target user who sent the item |
|
string |
|
federated_share_declined
Key | Type | Description |
---|---|---|
|
string |
The path of shared item |
|
string |
The target user who sent the item |
|
string |
|
Custom Groups
custom_group_member_removed
Key | Type | Description |
---|---|---|
|
string |
The UID of the user that was removed from the group |
|
string |
The custom group name |
custom_group_user_left
Key | Type | Description |
---|---|---|
|
string |
The UID of the user that left the group |
|
string |
The custom group name |
|
integer |
The custom group id |
custom_group_user_role_changed
Key | Type | Description |
---|---|---|
|
string |
The UID of the user that changed role |
|
string |
The custom group name |
|
integer |
The custom group id |
|
integer |
The new role number: 0 = member, 1= admin |
Comments
All comment events have the same data:
Key | Type | Description |
---|---|---|
|
string |
The comment identifier |
|
string |
The path to the file that the comment is attached to |
|
string |
The file identifier |
Config
Tags
Apps
Auth
File Lifecycle
(requires at least v1.0.0)
lifecycle_archived
Key | Type | Description |
---|---|---|
|
string |
The path to the file that was archived |
|
string |
The UID of the owner of the file that was deleted |
|
integer |
The file ID for the file that was archived |
lifecycle_restored
Key | Type | Description |
---|---|---|
|
string |
The path to the file that was restored |
|
integer |
The file ID for the file that was restored |
update_user_preference_value
Key | Type | Description |
---|---|---|
|
string |
The key |
|
string |
The value associated with the key |
|
string |
The name of the app |
|
string |
The UID of the user who has the preference key-value for the app |
user_preference_set
Key | Type | Description |
---|---|---|
|
string |
The key |
|
string |
The value associated with the key |
|
string |
The name of the app |
|
string |
The UID of the user who has the preference key-value for the app |
remove_user_preference_key
Key | Type | Description |
---|---|---|
|
string |
The key |
|
string |
The name of the app |
|
string |
The UID of the user whose preference key is deleted for the app |
Impersonate
SMB ACL
before_set_acl
Key | Type | Description |
---|---|---|
|
string |
The user who is trying to set the ACL |
|
string |
The owncloud instance path |
|
string |
The SMB path |
|
array |
The descriptor array. It contains to following keys: |
Key | Type | Description |
---|---|---|
|
integer |
Always |
|
string |
The SMB owner |
|
string |
The SMB group |
|
array |
A list of ACEs. The list could be empty. Each ACE contains following keys: |
Key | Type | Description |
---|---|---|
|
string |
The SMB user affected by this ACE |
|
string |
|
|
string |
Inheritance flags |
|
string |
Permission mask |
|
integer |
The inheritance flags as integer value |
|
integer |
The permission mask as integer value |
after_set_acl
Key | Type | Description |
---|---|---|
|
string |
The user who is trying to set the ACL |
|
string |
The owncloud instance path |
|
string |
The SMB path |
|
array |
The descriptor array. It contains to following keys: |
Key | Type | Description |
---|---|---|
|
integer |
Always |
|
string |
The SMB owner |
|
string |
The SMB group |
|
array |
A list of ACEs. The list could be empty. Each ACE contains following keys: |
Key | Type | Description |
---|---|---|
|
string |
The SMB user affected by this ACE |
|
string |
|
|
string |
Inheritance flags |
|
string |
Permission mask |
|
integer |
The inheritance flags as integer value |
|
integer |
The permission mask as integer value |
Key | Type | Description |
---|---|---|
|
array|false |
The previous descriptor array or false if the previous descriptor couldn’t be fetched. The previous descriptor will have the same keys |