Export audit events to CSV
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
- Navigate to Admin Area > Audit Log
- 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
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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