Establish parallel persistence for AuditEvent IP addresses
What does this MR do?
- Adds a new
ip_address
attribute toAuditEvent
- Refactors
AuditEventService
to write the IP address to the new attribute - Establishes parallel persistance so that the IP address is written to both the new attribute, and maintains the existing
details
hash. - Updates all frontend views and associated presenters to read from new attribute by default, falling back to
details
hash when appropriate.
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
Database Review
Rails Migration
== 20200605093113 AddIpAddressToAuditEvents: migrating ========================
-- add_column(:audit_events, :ip_address, :inet)
-> 0.0042s
== 20200605093113 AddIpAddressToAuditEvents: migrated (0.0043s) ===============
== 20200605093113 AddIpAddressToAuditEvents: reverting ========================
-- remove_column(:audit_events, :ip_address, :inet)
-> 0.0086s
== 20200605093113 AddIpAddressToAuditEvents: reverted (0.0118s) ===============
Edited by Max Woolf