[octane] Password in 'openstack' CLI command is not escaped

Bug #1585960 reported by Oleg S. Gelbukh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Oleg S. Gelbukh
8.0.x
Fix Committed
High
Anton Chevychalov
Mitaka
Fix Released
High
Ilya Kharin
Newton
Fix Committed
High
Oleg S. Gelbukh

Bug Description

Detailed bug description:

If the admin password passed to 'octane' command contains special symbols (e.g. parenthesis), the commands that specify the password in with CLI option will fail. See example below.

Steps to reproduce:

1. Install the Fuel Master node version 7
2. Install OpenStack cluster version 7.0 (Kilo)
3. Change password for 'admin' user in OpenStack cluster:

ssh node-1
...
. openrc
keystone user-list # Look up the user ID for 'admin'
keystone user-password-update --pass "admin)" <user_id>

4. Upgrade the Fuel Master node to version 8 (per documentation)
5. Run command 'octane upgrade-env <ENV_ID>'

Expected result:

New environment with random name created with release version 8

Actual result:

Command fails with the following error message:

2016-05-17 00:14:28 INFO octane.util.subprocess Process sh finished with return value 2
2016-05-17 00:14:28 ERROR octane Command 'sh' returned non-zero exit status 2
2016-05-17 00:14:28 ERROR octane.util.subprocess sh[at node-69] stderr: sh: 1: Syntax error: ")" unexpected

Reproducibility:

Always

Workaround:

Don't use special symbols in passwords

Impact:

Any Fuel Master node with admin password that contain special symbols

Description of environment:

N/A

Changed in fuel:
milestone: none → 8.0-updates
assignee: nobody → Fuel Octane (fuel-octane-team)
importance: Undecided → High
status: New → Confirmed
tags: added: area-upg
tags: added: area-up
removed: area-upg
tags: added: team-upgrades
removed: area-up
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-octane (master)

Fix proposed to branch: master
Review: https://review.openstack.org/332846

Changed in fuel:
assignee: Fuel Octane (fuel-octane-team) → Oleg S. Gelbukh (gelbuhos)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-octane (master)

Reviewed: https://review.openstack.org/332846
Committed: https://git.openstack.org/cgit/openstack/fuel-octane/commit/?id=58f31e6c5f408630c42565ee53de6b59457bc84c
Submitter: Jenkins
Branch: master

commit 58f31e6c5f408630c42565ee53de6b59457bc84c
Author: Oleg Gelbukh <email address hidden>
Date: Wed Jun 22 14:34:03 2016 +0000

    Escape passwords passed to openstack client

    If special symbols are used in password for 'admin' user in
    OpenStack, octane passes them to command line client as is
    and it breaks shell.

    Properly escape the password before passing it to subprocess.

    Change-Id: Iad635aec6d5b5cc32975937e00205b7e89dc99d9
    Closes-bug: 1585960

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-octane (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/332931

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-octane (stable/mitaka)
Download full text (40.5 KiB)

Reviewed: https://review.openstack.org/332931
Committed: https://git.openstack.org/cgit/openstack/fuel-octane/commit/?id=24f3c396612eb0c69fbf06bab3cebbb9ca829426
Submitter: Jenkins
Branch: stable/mitaka

commit b34d749f1c281dafbdbf155bd86830dc8f2a9aa2
Author: Ilya Kharin <email address hidden>
Date: Wed Jun 22 21:10:56 2016 +0300

    Support mock==1.8.0 in unit tests

    Use assert_called_once_with instead of assert_called_once that was
    introduced in 2.0.0.

    Change-Id: Ifb7699d4b552d148984961727355f0e23b487c7c

commit d60f1905143bb7576ffd670595de1c4aeafd7b34
Author: Ilya Kharin <email address hidden>
Date: Wed Jun 22 02:01:52 2016 +0300

    Allow to authorize by the predefined admin_token

    The admin_token_auth middleware is added to keystone pipelines to
    allow authorization by admin_token.

    Change-Id: Ic03150305a669fad1446436a68051fb9aa25b892

commit cc7fab59f44ffef60285f8732d798f52469b2530
Author: Ilya Kharin <email address hidden>
Date: Wed Jun 22 01:47:01 2016 +0300

    Reset default_domain_id before the keystone task

    The default_domain_id should be removed from keystone.conf after restore
    of DB and before to apply the keystone puppet task to avoid of using the
    configured domain as a default.

    Change-Id: I05a6c48532e8042496b3d8ccef53d65bf8c44653

commit e3f82399d567dbcfc1ae9a1ecbddba7bf5028fc8
Author: Ilya Kharin <email address hidden>
Date: Wed Jun 22 01:32:47 2016 +0300

    Add helper function to iterate over parameters

    The helpers.iterate_parameters function allows to iterate over lines of
    INI-like files along with a context of information, such section,
    parameter and value.

    Change-Id: I55b179118116fd5dacf100754057ea6589782dc2

commit 5ed370a4fbb3369d0f75873d205ac7f0c655f93a
Author: Ilya Kharin <email address hidden>
Date: Wed Jun 22 01:18:05 2016 +0300

    Add update_file context manager for local files

    The subprocess.update_file function provides an ability to update
    content of a local file by iterating over lines of an original file and
    forming a result content in a temporary file to replace the original
    file in the end. This function is very useful to change configuration
    files.

    Change-Id: I433a5da67887b231400dd63131799019f45c277c

commit 58f31e6c5f408630c42565ee53de6b59457bc84c
Author: Oleg Gelbukh <email address hidden>
Date: Wed Jun 22 14:34:03 2016 +0000

    Escape passwords passed to openstack client

    If special symbols are used in password for 'admin' user in
    OpenStack, octane passes them to command line client as is
    and it breaks shell.

    Properly escape the password before passing it to subprocess.

    Change-Id: Iad635aec6d5b5cc32975937e00205b7e89dc99d9
    Closes-bug: 1585960

commit 896aba1191eeb59cf85cc8be6a2ae67e08b76070
Author: Yuriy Taraday <email address hidden>
Date: Wed Jun 22 15:28:45 2016 +0300

    Add absolute_import to util/docker.py to avoid local tempfile module

    Closes-Bug: 1595156
    Change-Id: I9484efce6fa7aec1b41cf592f9e9768d85931fa7

commit 46586a62df962b2ce00b5d8a63f6fd34c920a1f4
Author: Oleg Gelbukh <email address hidden>
Date: Thu M...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-octane (stable/8.0)

Fix proposed to branch: stable/8.0
Review: https://review.openstack.org/333855

Revision history for this message
Vitaly Sedelnik (vsedelnik) wrote :

Removed from 8.0-mu-2 scope as the fix was not reviewed and merged on time

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-octane (stable/8.0)

Reviewed: https://review.openstack.org/333855
Committed: https://git.openstack.org/cgit/openstack/fuel-octane/commit/?id=a9a235e9f52a5c8f9f26c300978e0035f752484f
Submitter: Jenkins
Branch: stable/8.0

commit a9a235e9f52a5c8f9f26c300978e0035f752484f
Author: Oleg Gelbukh <email address hidden>
Date: Wed Jun 22 14:34:03 2016 +0000

    Escape passwords passed to openstack client

    If special symbols are used in password for 'admin' user in
    OpenStack, octane passes them to command line client as is
    and it breaks shell.

    Properly escape the password before passing it to subprocess.

    Change-Id: Iad635aec6d5b5cc32975937e00205b7e89dc99d9
    Closes-bug: 1585960
    (cherry picked from commit 58f31e6c5f408630c42565ee53de6b59457bc84c)

Revision history for this message
Ekaterina Shutova (eshutova) wrote :

Bug was verified, not working.
fuel-octane-8.0.0-1.mos1184.noarch.rpm does not contain necessary changes. Probably wrong package version was delivered.

tags: added: on-verification
description: updated
Revision history for this message
Vitaly Sedelnik (vsedelnik) wrote :

Retargeted to 8.0-mu-3

Revision history for this message
Anton Chevychalov (achevychalov) wrote :

Changes from https://review.openstack.org/333855 was completely overwritten by https://review.openstack.org/333855

So problem not exist any more because affected code was removed from 8.0.

Revision history for this message
Anton Chevychalov (achevychalov) wrote :

Affected code was removed in 8.0 MU2.

Revision history for this message
Dmitry Belyaninov (dbelyaninov) wrote :

Verified on snapshot #255

tags: removed: on-verification
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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