Skip to content

Avoid saving author object in audit_events table

Tan Le requested to merge 216577-fix-ruby-object-in-audit-event into master

What does this MR do?

This MR ensures we save failed login username instead of a serialised Ruby object representation (i.e. Gitlab::Audit::UnauthenticatedAuthor)

Before

                              details                               
--------------------------------------------------------------------
 ---                                                               +
 :failed_login: STANDARD                                           +
 :author_name: dsads                                               +
 :target_details: !ruby/object:Gitlab::Audit::UnauthenticatedAuthor+
   id: -1                                                          +
   name: dsads                                                     +
 :ip_address: 127.0.0.1                                            +
 :entity_path:                                                     +
 
(1 row)

After

                              details                               
--------------------------------------------------------------------
 ---                                                               +
 :failed_login: STANDARD                                           +
 :author_name: dsads                                               +
 :target_details: dsads                                            +
 :ip_address: 127.0.0.1                                            +
 :entity_path:                                                     +
 
(1 row)

Relates to #216577 (closed)

Screenshots

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