Bug 2024576

Summary: Extra audit record created on Organization create action
Product: Red Hat Satellite Reporter: Roman Plevka <rplevka>
Component: Audit LogAssignee: Ondřej Ezr <oezr>
Status: CLOSED ERRATA QA Contact: Sam Bible <sbible>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.10.0CC: inecas, oezr, sbible
Target Milestone: 6.12.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-16 13:32:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Roman Plevka 2021-11-18 11:40:15 UTC
Description of problem:
introduced in 6.10

When a new Organization is created, there is an extra "update" audit record generated:


```
[
  {
    "user_id": 4,
    "user_type": null,
    "user_name": "admin",
    "version": 2,
    "comment": null,
    "associated_id": null,
    "associated_type": null,
    "remote_address": "10.0.115.152",
    "associated_name": null,
    "created_at": "2021-11-10 18:09:34 UTC",
    "request_uuid": "4bd95f8f-a8b7-4fcc-a2be-888348cffce5",
    "id": 82,
    "auditable_id": 4,
    "auditable_name": "ABDkuTvlqzZ",
    "auditable_type": "Organization",
    "action": "update",
    "audited_changes": {
      "created_in_katello": [
        false,
        true
      ]
    },
    "locations": [],
    "organizations": [
      {
        "id": 4,
        "name": "ABDkuTvlqzZ",
        "title": "ABDkuTvlqzZ",
        "description": null
      }
    ]
  },
  {
    "user_id": 4,
    "user_type": null,
    "user_name": "admin",
    "version": 1,
    "comment": null,
    "associated_id": null,
    "associated_type": null,
    "remote_address": "10.0.115.152",
    "associated_name": null,
    "created_at": "2021-11-10 18:09:32 UTC",
    "request_uuid": "4bd95f8f-a8b7-4fcc-a2be-888348cffce5",
    "id": 76,
    "auditable_id": 4,
    "auditable_name": "ABDkuTvlqzZ",
    "auditable_type": "Organization",
    "action": "create",
    "audited_changes": {
      "name": "ABDkuTvlqzZ",
      "ignore_types": [],
      "description": null,
      "label": "ABDkuTvlqzZ",
      "ancestry": null,
      "manifest_refreshed_at": null,
      "created_in_katello": false
    },
    "locations": [],
    "organizations": [
      {
        "id": 4,
        "name": "ABDkuTvlqzZ",
        "title": "ABDkuTvlqzZ",
        "description": null
      }
    ]
  },
]
```

prior 6.10.0, the update-action record was not generated




Version-Release number of selected component (if applicable):
sat6.10.0

How reproducible:
always

Steps to Reproduce:
1. create a new organization
2. observer, there is an "update" audit record generated besides the "Create" one


Expected results:
only 1 record of type: create is expected to be generated

Additional info:

Comment 2 Bryan Kearney 2021-11-18 20:05:38 UTC
Upstream bug assigned to oezr

Comment 3 Bryan Kearney 2021-11-18 20:05:40 UTC
Upstream bug assigned to oezr

Comment 4 Bryan Kearney 2022-01-11 16:04:55 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/33952 has been resolved.

Comment 6 Sam Bible 2022-09-12 15:56:41 UTC
Version: Sat 6.12.0 - 10

Steps to Reproduce:
1) Create a new Organization
2) Check the audit logs

Expected Results: only 1 record of type: create is generated.

Actual Results: only 1 record of type: create is generated.

Comment 10 errata-xmlrpc 2022-11-16 13:32:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.12 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:8506