Bug #22208

broken tests due to audited 4.6 release

Added by Tomer Brisker 3 months ago. Updated 3 months ago.

Status:Closed
Priority:Normal
Assigned To:Tomer Brisker
Category:Audit Log
Target version:-
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/5172, https://github.com/theforeman/foreman/pull/5161, https://github.com/theforeman/foreman/pull/5166, https://github.com/theforeman/foreman/pull/5165
Story points-
Velocity based estimate-
Release1.16.1Release relationshipAuto

Description

Most likely related to changes in rails 5.1 change tracking

ImageTest::audits for password change.test_0002_audit of password change should be saved
UserTest::audits for password change.test_0001_audit of password change should be saved only once, second time audited changes should not contain password_changed
UserTest::audits for password change.test_0002_audit of password change should be saved

Related issues

Related to Foreman - Bug #22280: User Audits: False entry of "password changed" every time... New 01/16/2018

Associated revisions

Revision d55bec0a
Added by Tomer Brisker 3 months ago

Refs #22208 - pin audited to 4.5

4.6.0 versions causes test failures on models trying to prevent saved
passwords from being saved in the audit log. This is due to hacks we
added to core along with changes in rails 5.1 change tracking.
This should be fixed to work correctly in the code, but pinning for now
to prevent CI breakage.

Revision 59f0a945
Added by Tomer Brisker 3 months ago

Fixes #22208, #21920 - Refactor password auditing (#5162)

Recent changes in Rails 5.1 and audited gem cause our method of auditing
passwords to break. This PR refactors password auditing, so that instead
of recording a change to attribute `password_changed`, we will now
record the string `[redacted]` instead of any actual password.
The change is done currently in our audit extensions, which mean that it
will now apply to all resources that have a `password` attribute instead
of just those that have defined the workaround.
The next step will be to move this to the audited gem in a more
generalized method that can be defined in the model when initializing
audited, so that the workaround can be removed.

History

#1 Updated by Tomer Brisker 3 months ago

  • Category set to Audit Log

#2 Updated by The Foreman Bot 3 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5161 added

#3 Updated by The Foreman Bot 3 months ago

  • Pull request https://github.com/theforeman/foreman/pull/5162 added

#4 Updated by The Foreman Bot 3 months ago

  • Pull request https://github.com/theforeman/foreman/pull/5160 added

#5 Updated by Michael Moll 3 months ago

  • Release set to 1.16.1

this needs to get cherry-picked to 1.15 and 1.16

#6 Updated by The Foreman Bot 3 months ago

  • Pull request https://github.com/theforeman/foreman/pull/5165 added

#7 Updated by The Foreman Bot 3 months ago

  • Pull request https://github.com/theforeman/foreman/pull/5166 added

#8 Updated by The Foreman Bot 3 months ago

  • Pull request https://github.com/theforeman/foreman/pull/5172 added

#9 Updated by Marek Hulán 3 months ago

  • Pull request deleted (https://github.com/theforeman/foreman/pull/5162, https://github.com/theforeman/foreman/pull/5160)

#10 Updated by Anonymous 3 months ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#11 Updated by Marek Hulán 3 months ago

  • Related to Bug #22280: User Audits: False entry of "password changed" every time a user is updated added

Also available in: Atom PDF