Bug 1925532

Summary: Do not require RPM puppet-foreman_scap_client that is injecting Puppet Facts
Product: Red Hat Satellite Reporter: Anand Jambhulkar <ajambhul>
Component: PackagingAssignee: Eric Helms <ehelms>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.8.0CC: ahumbe, bbuckingham, ehelms, jbhatia, mhulan, peter.vreman, smajumda, smeyer, thadzhie, zhunting
Target Milestone: 6.14.0Keywords: Reopened, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2242908 (view as bug list) Environment:
Last Closed: 2023-11-08 14:17:32 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 Anand Jambhulkar 2021-02-05 13:17:51 UTC
Description of problem:
----------------------


The Satellite RPM depends on puppet-foreman_scap_client. This module has also a Facts that are ALLWAYS synced to the ALL Client even that i do not use the foramn_scap_client.


-----------
Dependencies Resolved

======================================================================================================================
 Package                         Arch        Version               Repository                                    Size
======================================================================================================================
Removing:
 puppet-foreman_scap_client      noarch      0.4.0-1.el7sat        @local-rhel-7-server-satellite-6.8-rpms       58 k
Removing for dependencies:
 satellite                       noarch      6.8.3-1.el7sat        @local-rhel-7-server-satellite-6.8-rpms       72

Transaction Summary
======================================================================================================================
Remove  1 Package (+1 Dependent package)

Installed size: 58 k
Is this ok [y/N]: n
-----------

---------
[crash/LI] root@li-lc-2224:~# cat /usr/share/puppet/modules/foreman_scap_client/lib/facter/rh_certificates.rb
def extract_certificates_from_subscription_manager
  certificates = {}
  certificate_end_path = '/cert.pem'
  private_key_end_path = '/key.pem'
  rh_default_ca_cert = '/etc/rhsm/ca/redhat-uep.pem'
  data = Facter::Util::Resolution.exec('/usr/sbin/subscription-manager config')
  return nil if data.nil? || data.empty?
  data = data.gsub("\n", "").gsub(/[\[\]]/, "")
  data_array = data.scan(/(\S+)\s*=\s* ([^ ]+)/)
  data_hash = Hash[*data_array.flatten]
  consumer_cert_dir = data_hash["consumercertdir"]
  certificates[:repo_ca_cert]          = data_hash["repo_ca_cert"] unless data_hash["repo_ca_cert"] == rh_default_ca_cert
  certificates[:host_certificate_path] = consumer_cert_dir + certificate_end_path
  certificates[:host_private_key_path] = consumer_cert_dir + private_key_end_path

  certificates
end

certificates_hash = extract_certificates_from_subscription_manager
# Set Katello certificates only if certificates_hash[:repo_ca_cert] exists
if certificates_hash && certificates_hash[:repo_ca_cert]
  Facter.add('rh_certificate_repo_ca_file') do
    setcode do
      certificates_hash[:repo_ca_cert]
    end
  end

  Facter.add('rh_certificate_consumer_host_cert') do
    setcode do
      certificates_hash[:host_certificate_path]
    end
  end

  Facter.add('rh_certificate_consumer_host_key') do
    setcode do
      certificates_hash[:host_private_key_path]
    end
  end
end
[crash/LI] root@li-lc-2224:~#
----------

Effect on the Client:
----------
vrempet-admin@li-lc-1437 ~
$ sudo facter -p | grep rh_
rh_certificate_consumer_host_cert => /etc/pki/consumer/cert.pem
rh_certificate_consumer_host_key => /etc/pki/consumer/key.pem
rh_certificate_repo_ca_file => /etc/rhsm/ca/katello-server-ca.pem

vrempet-admin@li-lc-1437 ~
$
----------


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

Satellite Server 6.8


Expected results:
----------------

1. Please give the Customer control over the Puppet Modules and Facts.

2. Please remove this RPM dependency from the top-level 'satellite' rpm so i can uninstall rpms that provide Puppet Modules that i am not using.

Comment 2 Brad Buckingham 2022-09-02 20:25:18 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team.  Thank you.

Comment 3 Brad Buckingham 2022-09-02 20:31:56 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team.  Thank you.

Comment 5 Brad Buckingham 2022-10-28 18:02:59 UTC
Thank you for your interest in Red Hat Satellite. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this feel free to contact your Red Hat Account Team. Thank you.

Comment 6 Peter Vreman 2022-10-31 09:18:05 UTC
Sorry, what is the problem of just removing the rpm from dependencies the Satellite rpm?

Comment 7 Brad Buckingham 2022-11-01 20:21:47 UTC
Hi Peter,

It may be possible; however, it needs to be investigated.  I will reach out to see if this something that can be addressed in the near-term.  If so, we can re-open.

Thanks!

Comment 12 Eric Helms 2023-07-14 23:16:09 UTC
*** Bug 2106654 has been marked as a duplicate of this bug. ***

Comment 13 Lukas Pramuk 2023-07-26 18:05:49 UTC
VERIFIED.

@Satellite 6.14.0 Snap8
satellite-6.14.0-3.el8sat.noarch

by the following steps:

# rpm -q puppet-foreman_scap_client
package puppet-foreman_scap_client is not installed

# rpm -qR satellite | grep puppet
<empty>

>>> puppet-foreman_scap_client package is now optional and not installed by default

Comment 16 errata-xmlrpc 2023-11-08 14:17:32 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.14 security and bug fix update), 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-2023:6818