Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1785813

Summary: [RFE] Add functionality in foreman logging to hash-out or mark as [FILTERED] the password in /var/log/foreman-maintain/foreman-maintain.log and /var/log/foreman-installer/satellite.log file
Product: Red Hat Enterprise Linux 7 Reporter: Pavel Moravec <pmoravec>
Component: sosAssignee: Jan Jansky <jjansky>
Status: CLOSED ERRATA QA Contact: Miroslav HradĂ­lek <mhradile>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.8CC: agk, bmr, cww, fkrska, jjansky, jreznik, mhradile, plambri, pmoravec, pvlasin, sbradley
Target Milestone: rcKeywords: FutureFeature, Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sos-3.9-5.el7_9.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-27 11:31:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pavel Moravec 2019-12-21 08:21:34 UTC
This bug was initially created as a copy of Bug #1785117

I am copying this bug because: 
The same change needs to be applied to sosreport. https://github.com/sosreport/sos/pull/1901 raised in upstream for it.


Description of problem:
    -  Satellite log files (/var/log/foreman-maintain/foreman-maintain.log and /var/log/foreman-installer/satellite.log) captures password in plain text:

      /var/log/foreman-maintain/foreman-maintain.log
      [33m/usr/share/candlepin/cpdb --update --database '//localhost/candlepin' --user 'candlepin' --password 'XXXXXXXXXXXXXXXXXXX' finished successfully!

      /var/log/foreman-installer/satellite.log
      Example entries:
      [DEBUG 2019-12-15T11:xx:54 main]  Executing: 'keytool -list -keystore /etc/candlepin/certs/amqp/candlepin.jks -storepass XXXXXXXXXXXXXXXXXX -alias amqp-client'
      [DEBUG 2019-12-15T11:29:54 main]  /Stage[main]/Certs::Candlepin/Exec[import client certificate into Candlepin keystore]: 'openssl pkcs12 -export -name amqp-client -in /etc/pki/katello/certs/java-client.crt -inkey /etc/pki/katello/private/java-client.key -out /tmp/keystore.p12 -passout file:/etc/pki/katello/keystore_password-file && keytool -importkeystore -destkeystore /etc/candlepin/certs/amqp/candlepin.jks -srckeystore /tmp/keystore.p12 -srcstoretype pkcs12 -alias amqp-client -storepass XXXXXXXXXXXXXXXX -srcstorepass YYYYYYYYYYYYYYYYY -noprompt && rm /tmp/keystore.p12' won't be executed because of failed check 'unless'
      [DEBUG 2019-12-15T11:29:15 main]    proxy_password = XXXXXXXXXXXXX


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


Steps to Reproduce RFE:
1. Checked entries in /var/log/foreman-maintain/foreman-maintain.log and /var/log/foreman-installer/satellite.log

Actual results:

 /var/log/foreman-maintain/foreman-maintain.log
      [33m/usr/share/candlepin/cpdb --update --database '//localhost/candlepin' --user 'candlepin' --password 'XXXXXXXXXXXXXXXXXXX' finished successfully!

      /var/log/foreman-installer/satellite.log
      Example entries:
      [DEBUG 2019-12-15T11:xx:54 main]  Executing: 'keytool -list -keystore /etc/candlepin/certs/amqp/candlepin.jks -storepass XXXXXXXXXXXXXXXXXX -alias amqp-client'
      [DEBUG 2019-12-15T11:29:54 main]  /Stage[main]/Certs::Candlepin/Exec[import client certificate into Candlepin keystore]: 'openssl pkcs12 -export -name amqp-client -in /etc/pki/katello/certs/java-client.crt -inkey /etc/pki/katello/private/java-client.key -out /tmp/keystore.p12 -passout file:/etc/pki/katello/keystore_password-file && keytool -importkeystore -destkeystore /etc/candlepin/certs/amqp/candlepin.jks -srckeystore /tmp/keystore.p12 -srcstoretype pkcs12 -alias amqp-client -storepass XXXXXXXXXXXXXXXX -srcstorepass YYYYYYYYYYYYYYYYY -noprompt && rm /tmp/keystore.p12' won't be executed because of failed check 'unless'
      [DEBUG 2019-12-15T11:29:15 main]    proxy_password = XXXXXXXXXXXXX


Expected results:

Passwords in the log file should not be stored in plain text as it becomes a major security threat.

Comment 20 errata-xmlrpc 2021-04-27 11:31:08 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 (sos bug fix and enhancement 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/RHBA-2021:1385