Skip to content

Export audit events to CSV

Tan Le requested to merge tancnle/export-audit-events-csv into master

What does this MR do?

Allow administrator to export audit events to CSV from Audit Log page. This MR only include backend changes.

feature flag (off by default): audit_log_export_csv

Sample CSV output audit-events-1597932764.csv

Relates to #1449 (closed)

Manual testing

  1. Navigate to Admin Area > Audit Log
  2. Enter the following URL in the browser

http://localhost:3000/admin/audit_log_reports.csv?created_after=2020-08-01&created_before=2020-09-01&entity_id=1&entity_type=User

Profiling

A CSV containing 10k worth of audit_events is roughly around 1.4Mb.

Database

This MR relies on the DB optimisation on !41266 (merged). Without this new index, the timing for the CSV export is rather poor (details of the query performance recorded in the related issue).

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Tan Le

Merge request reports