Hardcoded, weak, potentially unchangeable password in Cloudera plugin

Bug #1429989 reported by Travis McPeak
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Security Advisory
Won't Fix
Undecided
Unassigned
Sahara
Fix Released
Critical
Ken Chen

Bug Description

On this line:

https://github.com/openstack/sahara/blob/master/sahara/plugins/cdh/v5_3_0/versionhandler.py#L95 , a management interface is added with a configurable IP address but an apparently fixed username/password combo of 'admin'/'admin'.

Since this is a management interface it should be set so that the admin credentials are configurable. As this code doesn't contain any option to specify the username and password I can only assume that they are always set to these values, otherwise this code probably wouldn't work.

Since the code is OpenSource, an attacker has access to any hardcoded credentials such as these. These particular hardcoded credentials are particularly weak as they are the first thing any attacker would guess.

Changed in sahara:
milestone: none → next
milestone: next → kilo-3
Revision history for this message
Grant Murphy (gmurphy) wrote :

Since this report concerns a possible security risk, an incomplete security advisory task has been added while the core security reviewers for the affected project or projects confirm the bug and discuss the scope of any vulnerability along with potential solutions.

Changed in ossa:
status: New → Incomplete
Revision history for this message
Michael McCune (mimccune) wrote :

just to add a little reference to this bug. i believe the credentials presented in the code are the default values for the service that is installed on this type of virtual machine image. to make this fully configurable we will need to synchronize the image creation with the requested password. alternatively perhaps there is a way for sahara to reset the password once an image is running, that would avoid creating new images to inject the password.

Revision history for this message
Travis McPeak (travis-mcpeak) wrote :

So just to move along this discussion a little bit, what is the impact of having hardcoded guessable credentials for this service?

What is this service used for? Are there any access controls on it? If a user logs in as administrator, what potentially damaging actions can they perform?

Revision history for this message
Michael McCune (mimccune) wrote :

Travis, i will need to do some research about this specific application that is being installed but i believe it is a version of this[1]. having admin access will allow a user to control some of the functionality in the deployed cluster. i don't think it would allow access to any openstack services directly, but it may allow exploitation of the cluster nodes. i will followup with the cloudera folks.

in general, i think this may be a lower priority bug. i agree though that we should create a mechanism for allowing a customization of these values.

[1]: https://cloudera.com/content/cloudera/en/products-and-services/cloudera-enterprise/cloudera-manager.html

Revision history for this message
Thierry Carrez (ttx) wrote :

When was this added ? Is it a kilo feature ?

Revision history for this message
Michael McCune (mimccune) wrote :

This specific part is being added as part of kilo, it is a piece of the Cloudera plugin version increase to v5.3.0.

Revision history for this message
Thierry Carrez (ttx) wrote :

We won't issue an advisory on this unles it makes it into the Kilo release, so it might be better to just make this bug public and expedite fixing before release.

Unless someone complains we will make this bug public Thursday.

Revision history for this message
Sergey Lukjanov (slukjanov) wrote :

/me agreed with Thierry

Changed in sahara:
milestone: kilo-3 → kilo-rc1
Thierry Carrez (ttx)
information type: Private Security → Public Security
information type: Public Security → Public
Changed in ossa:
status: Incomplete → Won't Fix
Changed in sahara:
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Michael McCune (mimccune) wrote :

this review

https://review.openstack.org/#/c/165077/

is addressing this bug

Changed in sahara:
assignee: nobody → Michael McCune (mimccune)
Revision history for this message
Ken Chen (ken-chen-i) wrote :

I have one question: for we assume the cluster user will not use the password, why should we put it in configuration file? Can we generate the cloudera_manager password by uuid and store it in conductor db? I fact, currently the hive&sentry database passwords are generated by this method, in db_helper.py in cdh plugin. We may do the same thing for cloudera_manager password, and remove it from configuration file. I have already tried this method in my setup and it works. This also brings another advantage: each cluster can has its own admin password.

Revision history for this message
Michael McCune (mimccune) wrote :

Ken, that would be another possible approach. if the user is never going to need that password then we could shift to a randomized password. will the end user ever need to login to the Cloudera Manager?

also, if we do move to a randomized password, will we need to add something that will set the password on the manager? my impression is that the current setting is the default for an installed Cloudera Manager and that to change that default the user would need to alter the image, is this accurate?

Changed in sahara:
status: Confirmed → In Progress
Revision history for this message
Ken Chen (ken-chen-i) wrote :

Michael, we do not need to change the image. The only thing is we need to change the password of CM user 'admin'. That can be done via cm_api update_user, like below style:
    api = get_api_client(cluster)
    user = api.get_user('admin')
    user.password = 'something'
    api.update_user(user)

Revision history for this message
Michael McCune (mimccune) wrote :

thanks Ken, that is helpful. i'm still concerned about the extended implications of changing to a randomized password at this point in the process. i'm wondering if this approach will become a large enough change that we should create a spec for it and target for Liberty time frame.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on sahara (master)

Change abandoned by Michael McCune (<email address hidden>) on branch: master
Review: https://review.openstack.org/165077
Reason: Ken Chen is addressing this issue with a different approach that is more acceptable going forward.

Ken Chen (ken-chen-i)
Changed in sahara:
assignee: Michael McCune (mimccune) → Ken Chen (ken-chen-i)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to sahara (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to sahara (master)

Reviewed: https://review.openstack.org/166279
Committed: https://git.openstack.org/cgit/openstack/sahara/commit/?id=961d8ccd8e5ee1ddeb32ef9d84faeed694ec937e
Submitter: Jenkins
Branch: master

commit 961d8ccd8e5ee1ddeb32ef9d84faeed694ec937e
Author: Ken Chen <email address hidden>
Date: Fri Mar 20 23:17:25 2015 +0800

    Generate random password for CM admin user

    We use uuid to create and apply a random password for CM admin user.

    SecurityImpact

    Closes-Bug: #1429989
    Change-Id: Ie03f73cd07561f3ae7dcdbf97087b7a8e02417d1

Changed in sahara:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in sahara:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in sahara:
milestone: kilo-rc1 → 2015.1.0
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.