Choose what activity is recorded
Choose the users, groups and organizations whose reads, files and exports OpenCTI records, and send the audit log to files, the console or your log pipeline.
OpenCTI records the administration and security actions of every user without any setting. This page shows how to add extended activity for chosen users, groups or organizations, and how to route the audit log to your log pipeline. Read Audit who did what first for what each kind of record covers.
Before you start
- Your platform has an Enterprise Edition license.
- Your role has the Access security activity capability.
- To change where the audit log goes, you can edit the platform configuration and restart the platform.
Listen to users, groups or organizations
Extended activity records what people read, upload, download, import, export and search. It costs storage and indexing time, so listen to the people who need it rather than to everyone.
-
Open .
-
In Extended activity logging, choose a user in Add a user, a group in Add a group, or an organization in Add an organization. It is added to the list below at once.
-
Repeat for everyone to listen to. A group or an organization covers all its members.
OpenCTI 7.261119.0
Recording starts right away; actions taken before are not recovered. To stop listening, click the delete icon on the line of the user, group or organization.
Check that it works
Log in as a listened user, open a report and download one of its files. In , filter on that user: a read event and a file event with the scope download appear. See Activity events.
Send activity to your log pipeline
Besides the events screen, OpenCTI writes audit events as JSON lines to a daily audit.log file and to the console, where a container log collector picks them up. Set these keys in the platform configuration, or as environment variables, then restart the platform:
| Key (environment variable) | Default | Use it to |
|---|---|---|
app:audit_logs:logs_files (APP__AUDIT_LOGS__LOGS_FILES) | true | Write the audit.log file, one per day |
app:audit_logs:logs_directory (APP__AUDIT_LOGS__LOGS_DIRECTORY) | ./logs | Choose the folder of the file. In a container, mount a volume there, or the files are lost when the container is replaced |
app:audit_logs:logs_max_files (APP__AUDIT_LOGS__LOGS_MAX_FILES) | 7 | Choose how many daily files are kept. Older files are deleted |
app:audit_logs:logs_console (APP__AUDIT_LOGS__LOGS_CONSOLE) | true | Write the events to the console |
app:audit_logs:logs_in_transports (APP__AUDIT_LOGS__LOGS_IN_TRANSPORTS) | ["administration"] | Add extended to also write extended events to the file and the console |
app:audit_logs:trace_request_headers (APP__AUDIT_LOGS__TRACE_REQUEST_HEADERS) | ["user-agent", "x-forwarded-for"] | Choose the HTTP headers recorded with each event |
Turning off both logs_files and logs_console stops the audit log, not the activity: the events screen and the triggers keep working.
Example CERT lets the contractors of its partner Harbor Security work on its platform, and its security team must keep a trace of everything they read and download, in its log pipeline as well as in OpenCTI.
- In , choose the Harbor contractors group in Add a group. Every current and future member of the group is listened to, such as Sam Reyes.
- Add the analysts of the team who handle sensitive cases one by one in Add a user, rather than their whole group.
- Write the extended events to the console and to the
audit.logfile too, keep 30 daily files on a mounted volume, and record the client address the reverse proxy sets, then restart the platform. With Docker Compose:
services:
opencti:
environment:
APP__AUDIT_LOGS__LOGS_IN_TRANSPORTS: '["administration","extended"]'
APP__AUDIT_LOGS__LOGS_DIRECTORY: /opt/opencti/audit
APP__AUDIT_LOGS__LOGS_MAX_FILES: 30
APP__AUDIT_LOGS__TRACE_REQUEST_HEADERS: '["user-agent","x-forwarded-for","x-real-ip"]'
volumes:
- opencti-audit:/opt/opencti/audit
volumes:
opencti-audit:
When Sam Reyes downloads the PDF of the report "Night-time exports from a hotel booking platform", the events screen shows a file event with the scope download, and the same event reaches the log collector as a JSON line. Analysts outside the listened group and users leave only their administration and security events, which keeps the volume low.
The configuration reference lists these keys with the rest. The format of a log line is in Activity events.
What's next
- Get alerted on security events to be notified of the events that matter.
- Activity events for every event type and scope.
- The audit event reference, which marks each event as audit or extended.