Skip to content

WIP: Fix audit log recording full_path instead of ID

What does this MR do?

Newly created projects (and other objects) were storing the full_path in target_id instead of the project's primary key. This MR refactors some of the helper methods in AuditEventService to rectify this.

Before

{"severity":"INFO","time":"2020-05-05T15:40:02.084Z","correlation_id":"n4lGSzSadba","author_id":1,"entity_id":43,"entity_type":"Project","add":"project","author_name":"Administrator","target_id":"flightjs/brand-new-project","target_type":"Project","target_details":"flightjs/brand-new-project","ip_address":"127.0.0.1","entity_path":"flightjs/brand-new-project"}

After

{"severity":"INFO","time":"2020-05-06T08:46:44.997Z","correlation_id":"6972b5dcb2c389e6226188f5c919f96c","author_id":24,"entity_id":19,"entity_type":"Project","add":"project","author_name":"John Doe25","target_id":19,"target_type":"Project","target_details":"user24/gitlab"}

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

Closes #12599 (closed)

Edited by Max Woolf

Merge request reports