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 1325943

Summary: [RFE] sosreport does not contain domain specific information for keystone
Product: Red Hat Enterprise Linux 7 Reporter: Darin Sorrentino <dsorrent>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Miroslav HradĂ­lek <mhradile>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: agk, bmr, dsorrent, gavin, lyarwood, mburns, mhradile, plambri, sbradley
Target Milestone: rcKeywords: FutureFeature, OtherQA
Target Release: 7.5   
Hardware: x86_64   
OS: Linux   
URL: https://github.com/sosreport/sos/pull/1086
Whiteboard:
Fixed In Version: sos-3.5-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 18:00:19 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 Darin Sorrentino 2016-04-11 13:10:30 UTC
Description of problem:

Running a sosreport on a controller node does not capture the data for multi-domain configurations within the environment.

If the /etc/keystone/keystone.conf file has multi-domains configured by setting option 'domain_config_dir', we should also gather the files in the directory specified by 'domain_config_dir'.

Those files contain settings specific to domains created within the OpenStack environment which are valuable in troubleshooting.

If the files contain LDAP information, they will also contain a password in plain-text so prior to adding the files to the tar file, we should blank out the password listed in the file by replacing it with XXXXXXXX.

An example of this file can be seen in section 2.9.5b here:

https://access.redhat.com/documentation/en/red-hat-enterprise-linux-openstack-platform/version-7/integrate-with-identity-service/#configure_the_controller_2



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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Bryn M. Reeves 2016-04-11 14:20:13 UTC
Does the 'openstack-config' command also support a '--get'?

We'll need something like this to retrieve the value of domain_config_dir - plugins are not in the business of parsing the configuration data of other components.

Comment 3 Lee Yarwood 2016-04-11 15:34:54 UTC
(In reply to Bryn M. Reeves from comment #2)
> Does the 'openstack-config' command also support a '--get'?

Yes it does, it's just a wrapper around crudini really.
 
> We'll need something like this to retrieve the value of domain_config_dir -
> plugins are not in the business of parsing the configuration data of other
> components.

Yeah understood, I'll take a swing at this upstream shortly.

Comment 4 Pavel Moravec 2017-01-19 10:23:55 UTC
So the change should be:

- in openstack_keystone sos plugin?

- with pseudocode like:

dir=$(openstack-config --get /etc/keystone/keystone.conf domain_config_dir)
if [ $dir ]; then
  copy whole $dir directory
  obfuscate LDAP plaintext passwords in the dir
fi

Is that correct?


Two technical questions:
- what is the openstack-config --get output in either case (variable set, variable not set)? Required for proper parsing the output

- what's the string identifying LDAP password? Or ideally, can you provide regexp searching for it and replacing by series of '*' ?

Example:

        self.do_path_regex_sub(directory,
                               r"(AuthLDAPBindPassword)\s*(.*)",
                               r"\1********")

Comment 6 Darin Sorrentino 2017-04-03 13:08:32 UTC
Sorry, I read this comment a while ago and didn't realize it was to me...

(In reply to Pavel Moravec from comment #4)
> So the change should be:
> 
> - in openstack_keystone sos plugin?

I am not sure as I am not familiar with the SOS report plugin architecture? 

> 
> - with pseudocode like:
> 
> dir=$(openstack-config --get /etc/keystone/keystone.conf domain_config_dir)
> if [ $dir ]; then
>   copy whole $dir directory
>   obfuscate LDAP plaintext passwords in the dir
> fi
> 
> Is that correct?
> 

You still need to pass the section name when doing the get as far as I know. I'd also confirm it's existence in the if statement to prevent against user error. So it would be:

dir=$(openstack-config --get /etc/keystone/keystone.conf identity domain_config_dir)
if [ -d $dir ]; then
   copy whole $dir directory
   obfuscate LDAP plaintext passwords in the dir
fi



> 
> Two technical questions:
> - what is the openstack-config --get output in either case (variable set,
> variable not set)? Required for proper parsing the output

If it's not set, it is null:

[root@overcloud-controller-1 keystone]# export dir=$(openstack-config --get /etc/keystone/keystone.conf identity domain_config_dir)
Parameter not found: domain_config_dir
[root@overcloud-controller-1 keystone]# echo ">$dir<"
><
[root@overcloud-controller-1 keystone]#



> 
> - what's the string identifying LDAP password? Or ideally, can you provide
> regexp searching for it and replacing by series of '*' ?
> 
> Example:
> 
>         self.do_path_regex_sub(directory,
>                                r"(AuthLDAPBindPassword)\s*(.*)",
>                                r"\1********")

         self.do_path_regex_sub(directory,
                                r"^\s*(password)\s*=\s*(.*)",
                                r"\1********")

I'm not a programmer but based on your example, I think it would look like:

         self.do_path_regex_sub(directory,
                                r"^\s*(password)\s*=\s*(.*)",
                                r"\1********")


You can copy the example from section 4b here to test it:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_openstack_platform/7/html-single/integrate_with_identity_service/#configure_the_controller_2

Comment 7 Pavel Moravec 2017-04-04 08:34:57 UTC
(In reply to Darin Sorrentino from comment #6)
> Sorry, I read this comment a while ago and didn't realize it was to me...
> 
> (In reply to Pavel Moravec from comment #4)
> > So the change should be:
> > 
> > - in openstack_keystone sos plugin?
> 
> I am not sure as I am not familiar with the SOS report plugin architecture? 
>

No problem. I meant by that question how to identify systems where the new commands shall be run - roughly saying "only on OpenStack Keystone server", technically on any system with either package:

        'openstack-keystone',
        'python-keystone',
        'python-django-openstack-auth',
        'python-keystoneclient'

installed. (presence of either of those packages automatically triggers execution of openstack_keystone plugin, so this plugin shall contain the commands).

Thanks for answers, I will work on patch later on. We are behind 7.4 schedule so this shall go to 7.5 by default.

Comment 8 Pavel Moravec 2017-09-01 20:37:46 UTC
Upstream PR: https://github.com/sosreport/sos/pull/1086

It would be great to pre-verify it (incl. password obfuscation) if possible.

Comment 10 Pavel Moravec 2017-11-02 15:15:49 UTC
Fixed via sos 3.5 rebase.

Comment 19 errata-xmlrpc 2018-04-10 18:00:19 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/RHEA-2018:0963