Bug 1247120

Summary: [RFE] Installer should only show puppet diffs when executed with --verbose
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: Foreman DebugAssignee: Lukas Zapletal <lzap>
Status: CLOSED DUPLICATE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 6.1.0CC: bbuckingham, bkearney, gmollett, inecas, mhulan, ohadlevy, pmoravec, xdmoon, zhunting
Target Milestone: UnspecifiedKeywords: FutureFeature, Security, Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-22 09:15:26 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:
Bug Depends On:    
Bug Blocks: 1406384    

Description Pavel Moravec 2015-07-27 11:38:15 UTC
Description of problem:
It is great that foreman-debug obfuscates various passwords and secrets from yaml files, but the same secrets are collected in plaintext in katello-installer logs, due to puppet diff output.

Such a diff is worth to be left there, to understand what change is really applied by the installer. Rather the passwords in the logfiles need to be additionally obfuscated.


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


How reproducible:
100%


Steps to Reproduce:
1. katello-installer --katello-proxy-password "SomeSecretPassword"
(use other options, this one is just 1 example)

2. foreman-debug
3. Extract foreman-debug and grep for SomeSecretPassword


Actual results:
The password is present in var/log/katello-installer/katello-installer.*log files, like:

[DEBUG 2015-07-20 10:19:51 main]  Executing 'diff -u /etc/pulp/server/plugins.conf.d/puppet_importer.json /tmp/puppet-file20150720-32625-1gpaiex'
[ WARN 2015-07-20 10:19:51 main]  /Stage[main]/Pulp::Config/File[/etc/pulp/server/plugins.conf.d/puppet_importer.json]/content:
[ INFO 2015-07-20 10:19:51 main] --- /etc/pulp/server/plugins.conf.d/puppet_importer.json       2015-07-20 10:09:42.117415688 +0200
[ INFO 2015-07-20 10:19:51 main] +++ /tmp/puppet-file20150720-32625-1gpaiex     2015-07-20 10:19:51.599985763 +0200
[ INFO 2015-07-20 10:19:51 main] @@ -1,8 +1,8 @@
[ INFO 2015-07-20 10:19:51 main]  {
[ INFO 2015-07-20 10:19:51 main] -    "proxy_host": "",
[ INFO 2015-07-20 10:19:51 main] +    "proxy_host": "http://my.proxy.example.com",
[ INFO 2015-07-20 10:19:51 main]
[ INFO 2015-07-20 10:19:51 main] -    "proxy_port": null,
[ INFO 2015-07-20 10:19:51 main] +    "proxy_port": 8080,
[ INFO 2015-07-20 10:19:51 main]
[ INFO 2015-07-20 10:19:51 main] -    "proxy_username": "",
[ INFO 2015-07-20 10:19:51 main] -    "proxy_password": ""
[ INFO 2015-07-20 10:19:51 main] +    "proxy_username": "my_username",
[ INFO 2015-07-20 10:19:51 main] +    "proxy_password": "SomeSecretPassword"
[ INFO 2015-07-20 10:19:51 main]  }


Expected results:
All passwords and secrets that are being obfuscated in /etc/katello-installer/answers.katello-installer.yaml need to be obfuscated also in /var/log/katello-installer/katello-installer.*log files.


Additional info:

Comment 1 Ivan Necas 2015-07-27 11:39:35 UTC
Due to security properly of the BZ, marking as private

Comment 2 RHEL Program Management 2015-07-27 11:45:09 UTC
Since this issue was entered in Red Hat Bugzilla, the pm_ack has been
set to + automatically for the next planned release

Comment 3 Bryan Kearney 2016-01-08 16:53:29 UTC
Ohad, any idea if the installer can be changed to not log this in the first place?

Comment 4 Ohad Levy 2016-02-22 09:20:53 UTC
its possible to tell puppet to not show diffs in the first place, it can be done by adding " --no-show_diff" probably easy to add to kafo.

Comment 5 Bryan Kearney 2016-02-22 13:22:43 UTC
This is really an rfe.

Comment 7 Bryan Kearney 2016-07-07 15:32:30 UTC
Additional workaround include changing the default admin password after the installer has executed.

Comment 16 Lukas Zapletal 2016-12-22 08:25:11 UTC
Making the initial conversation public since the low-scored CVE was published.

To be honest, this should have been fixed in the installer. When running with default options, no diff output should have been added to the logs. When it is executed with -v option (verbose on stdout), we can add the diffs so user still can track changes when needed.

I am flipping this back to installer, if you guys do not confirm this, please do not flip this back to foreman-debug bug rather close this as dupe of https://bugzilla.redhat.com/show_bug.cgi?id=1370168 which already contains some generic filtering improvements.

Comment 17 Marek Hulan 2016-12-22 09:15:26 UTC
After discussion with Lukas, I'm marking this as a duplicate of bz 1370168. Installer does not expose log files world readable and logging template diffs is useful. Pavel, please watch the progress in bz 1370168.

*** This bug has been marked as a duplicate of bug 1370168 ***