Bug 1730360 - Missing audit records for Host Create
Summary: Missing audit records for Host Create
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Audit Log
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: 6.6.0
Assignee: Kavita
QA Contact: Roman Plevka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-16 14:09 UTC by Roman Plevka
Modified: 2019-10-22 19:47 UTC (History)
2 users (show)

Fixed In Version: foreman-1.22.0.23-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-22 19:47:23 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 27346 Normal Closed Missing audit records for Host Create 2020-01-30 10:09:43 UTC

Description Roman Plevka 2019-07-16 14:09:27 UTC
Description of problem:
The only audit record that appears is of action: Add
The test fails (at least) since 6.6.0-2

Version-Release number of selected component (if applicable):
6.6.0-2

Steps to Reproduce:
1. create a host
2. check audits
3. observe that the audit record for a host type has action "Added" and only 1 summary field

Expected results:
action type: "create", containing table of attributes and values

Comment 4 Marek Hulan 2019-07-16 14:23:53 UTC
This is caused by https://projects.theforeman.org/issues/26123/, more specifically https://github.com/theforeman/foreman/commit/c8effc1749b59abb15b315776b461f188805b736#diff-38f66014c76f64cd58c0e31a42681dcbR124 does not longer detect Host as main type. The reason is that the class in audited table is Host::Base, which never is considered audited (unlike Host::Managed). I think the easiest option is just to add Host::Base class to this list (hardcoding this again, but we also include other classes dynamically). There may be more such classes. Kavita, could you please take a look? I'm happy to do the review.

Comment 6 Kavita 2019-07-19 10:27:03 UTC
Created redmine issue https://projects.theforeman.org/issues/27346 from this bug

Comment 7 Kavita 2019-07-19 10:27:52 UTC
(In reply to Marek Hulan from comment #4)
Kavita, could you please take a look? I'm happy to do the review.

Sure, I will look into this.

Comment 8 Bryan Kearney 2019-07-19 12:07:45 UTC
Upstream bug assigned to kgaikwad@redhat.com

Comment 12 Roman Plevka 2019-09-17 09:30:16 UTC
VERIFIED
on sat6.6.0-20.1


Affected Organizations: Default Organization
Affected Locations: Default Location

there are 2 records per Host Create event created, apparently, 1 is for foreman host and the other one for katello content host:

Name: jess-steckel.foo.bar.com
Root pass: 5$eqHxv60GBFrtjzsu$t8VzRVDbnYU3bpPGVsUJzCcjpaB2m0zWwB0wDt5Y1/8
Architecture: x86_64
Operatingsystem: RedHat 8.0
Environment: production
Ptable: Kickstart default
Build: true
Hostgroup: hg1
Owner: N/A
Owner type: User
Enabled: true
Managed: true
Uuid: c60c9154-8664-42da-b6c1-9eba80b3cff5
Compute resource: lv (Libvirt)
Organization: Default Organization
Location: Default Location
Provision method: build
Grub pass: $5$eqHxv60GBFrtjzsu$t8VzRVDbnYU3bpPGVsUJzCcjpaB2m0zWwB0wDt5Y1/8
Pxe loader: PXELinux BIOS
Content facet attributes: {"id"=>nil, "host_id"=>nil, "uuid"=>nil, "content_view_id"=>1, "lifecycle_environment_id"=>1, "kickstart_repository_id"=>1, "content_source_id"=>1, "installable_security_errata_count"=>0, "installable_enhancement_errata_count"=>0, "installable_bugfix_errata_count"=>0, "applicable_rpm_count"=>0, "upgradable_rpm_count"=>0, "applicable_module_stream_count"=>0, "upgradable_module_stream_count"=>0}
Ansible role ids: [empty]



Affected Organizations: Default Organization
Affected Locations: Default Location
Host: [empty]
Content view: Default Organization View
Lifecycle environment: Library
Kickstart repository: [empty]
Content source: sgi-uv300-02.khw2.foo.bar.com
Installable security errata count: 0
Installable enhancement errata count: 0
Installable bugfix errata count: 0
Applicable rpm count: 0
Upgradable rpm count: 0
Applicable module stream count: 0
Upgradable module stream count: 0

Comment 13 Bryan Kearney 2019-10-22 19:47:23 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, 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-2019:3172


Note You need to log in before you can comment on or make changes to this bug.