In pike ssl deployment horizon cnt retrieve volumes/snapshots and service data via cinderclient

Bug #1744670 reported by Alexey Ananchenko
38
This bug affects 11 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Akihiro Motoki
keystoneauth
Incomplete
Undecided
Unassigned
python-cinderclient
Fix Released
Medium
Ivan Kolodyazhny

Bug Description

Ops packages versions:
openstack-cinder.noarch 11.0.1-1.el7
openstack-dashboard.noarch 12.0.1-1.el7
openstack-glance.noarch 15.0.0-2.el7
openstack-keystone.noarch 12.0.0-1.el7
openstack-neutron.noarch 11.0.2-2.el7
openstack-neutron-common.noarch 11.0.2-2.el7
openstack-neutron-ml2.noarch 11.0.2-2.el7
openstack-nova-api.noarch 16.0.3-2.el7
openstack-nova-common.noarch 16.0.3-2.el7
openstack-nova-conductor.noarch 16.0.3-2.el7
openstack-nova-console.noarch 16.0.3-2.el7
openstack-nova-novncproxy.noarch 16.0.3-2.el7
openstack-nova-placement-api.noarch 16.0.3-2.el7
openstack-nova-scheduler.noarch 16.0.3-2.el7
python2-cinderclient.noarch 3.1.0-1.el7

Only after applying hard-coded links to certificate in cinder-client and keystone, the dashboard starts working:

/cinderclient/client.py

        if self.timeout:
            kwargs.setdefault('timeout', self.timeout)
        self.http_log_req((url, method,), kwargs)
        resp = requests.request(
            method,
            url,
+ cert = ("/etc/keystone/ssl/certs/signing_cert.pem",
            "/etc/keystone/ssl/private/signing_key.pem"),
            verify=self.verify_cert,
            **kwargs)
        self.http_log_resp(resp)

/keystoneauth1/session.py

    def __init__(self, auth=None, session=None, original_ip=None, verify=True,
                 cert=None, timeout=None, user_agent=None,
                 redirect=_DEFAULT_REDIRECT_LIMIT, additional_headers=None,
                 app_name=None, app_version=None, additional_user_agent=None,
                 discovery_cache=None):

        self.auth = auth
        self.session = _construct_session(session)
        self.original_ip = original_ip
        self.verify = verify
- self.cert = cert
+ self.cert = ("/etc/keystone/ssl/certs/signing_cert.pem",
        "/etc/keystone/ssl/private/signing_key.pem")
        self.timeout = None
        self.redirect = redirect
        self.additional_headers = additional_headers or {}
        self.app_name = app_name
        self.app_version = app_version
        self.additional_user_agent = additional_user_agent or []
        self._determined_user_agent = None
        if discovery_cache is None:
            discovery_cache = {}
        self._discovery_cache = discovery_cache

description: updated
description: updated
Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

I am not sure what is happening here that is causing the certificate information to not be passed down. It seems like cinderclient is using requests directly (in Pike). And whatever else is calling keystoneauth is not passing the cert value to keystoneauth. If the cert values are not passed to keystone auth it is not possible for KSA to understand where to get the cert information from.

I am not sure what we need to do to solve this directly or if it is still an issue. Can you post your tracebackes/errors?

Marking incomplete until we have more information.

Changed in keystoneauth:
status: New → Incomplete
Ivan Kolodyazhny (e0ne)
Changed in python-cinderclient:
status: New → Confirmed
assignee: nobody → Ivan Kolodyazhny (e0ne)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-cinderclient (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/675891

Ivan Kolodyazhny (e0ne)
Changed in horizon:
status: New → Confirmed
assignee: nobody → Ivan Kolodyazhny (e0ne)
importance: Undecided → Medium
Changed in python-cinderclient:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.opendev.org/675894

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-cinderclient (master)

Reviewed: https://review.opendev.org/675891
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=4a3a2c3c9a89ccff4e64d3da96de5b0af4303840
Submitter: Zuul
Branch: master

commit 4a3a2c3c9a89ccff4e64d3da96de5b0af4303840
Author: Ivan Kolodyazhny <email address hidden>
Date: Mon Aug 12 15:44:31 2019 +0300

    Add custom CA support for get_server_version

    get_server_version fails when self-signed CA cert is used. This patch
    adds:
    * insecure option to ignore SSL certificate validation
    * cacert to add ability to provide a custom SSL certificate

    Change-Id: Ib1d34a5a6b595c53473ddd3acb182ab5a39cbba5
    Related-Bug: 1744670

Changed in horizon:
assignee: Ivan Kolodyazhny (e0ne) → Akihiro Motoki (amotoki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.opendev.org/675894
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=285c51f7e1b27a786fa9684abdc489998285b4e2
Submitter: Zuul
Branch: master

commit 285c51f7e1b27a786fa9684abdc489998285b4e2
Author: Ivan Kolodyazhny <email address hidden>
Date: Mon Aug 12 16:19:44 2019 +0300

    Add custom SSL CA Cert support for api.cinder.get_microversion

    api.cinder.get_microversion function now supports OPENSTACK_SSL_NO_VERIFY
    and OPENSTACK_SSL_CACERT config options.

    This depends on commit 4a3a2c3c9a89ccff4e64d3da96de5b0af4303840 in
    python-cinderclient, so the minimum version of python-cinderclient
    is bumped to 5.0.0.

    NOTE(amotoki): The stretegy of backporting to stable branches needs
    a discussion with the requirements team as we cannot bump the
    minimum version (at least the major version bump is surprising).

    Change-Id: I22c6c60e10d8e9328f7f1e0c24d6c74496ec1a71
    Closes-Bug: 1744670

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 17.1.0

This issue was fixed in the openstack/horizon 17.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/710174

Eric Harney (eharney)
Changed in python-cinderclient:
status: Confirmed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/train)

Reviewed: https://review.opendev.org/710174
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=68d4c5e78db61ea401ee89c84a69676e26a636a1
Submitter: Zuul
Branch: stable/train

commit 68d4c5e78db61ea401ee89c84a69676e26a636a1
Author: Akihiro Motoki <email address hidden>
Date: Thu Feb 27 11:29:23 2020 +0900

    Add custom SSL CA Cert support for api.cinder.get_microversion

    This is a stable branch version of
    commit 285c51f7e1b27a786fa9684abdc489998285b4e2 in the master branch.
    custom SSL CA Cert support in python-cinderclient was introduced
    in 5.0.0, but horizon train supports python-cinderclient >=4.0.1,
    so we cannot backport it as-is.

    This commit borrowed the logic of get_server_version() from
    python-cinderclient 5.0.0 so that this can be backported to
    older releases than train.

    From the above reason, this is directly proposed to stable/train.

    Change-Id: I776d2c8c6864067e7b44ce4b2f107c80b8b6d7fb
    Closes-Bug: #1744670

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 16.2.1

This issue was fixed in the openstack/horizon 16.2.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.