Skip to content

Establish parallel persistence for AuditEvent IP addresses

Max Woolf requested to merge 217442-refactor-ip-address-in-auditevent into master

What does this MR do?

  • Adds a new ip_address attribute to AuditEvent
  • 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

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

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

Merge request reports