Bug 1233513 - Passwords are shown in the web console
Summary: Passwords are shown in the web console
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Templates
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 3.5.z
Assignee: Scott Dodson
QA Contact: XiuJuan Wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-19 05:05 UTC by Tomas Schlosser
Modified: 2017-04-25 17:41 UTC (History)
22 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Parameter values were used to directly populate environment variables. Consequence: The value of the environment variable is exposed in the web console, potentially exposing password credentials. Fix: Set the environment variable indirectly via a secret and set the secret from a parameter value. Result: The environment variable value will not be displayed by the web console by default.
Clone Of:
Environment:
Last Closed: 2017-04-25 17:41:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CLOUD-1511 0 Major Open Use secrets for password variables to hide their display in the OpenShift console 2018-07-25 08:15:13 UTC
Red Hat Product Errata RHBA-2017:1140 0 normal SHIPPED_LIVE OpenShift Container Platform atomic-openshift-utils bug fix and enhancement 2017-04-25 21:41:12 UTC

Description Tomas Schlosser 2015-06-19 05:05:38 UTC
There is no mechanism to hide passwords passed through environment variables. So you can see in web console values of all passwords:
DB_PASSWORD=XO87brdc
EAP_HTTPS_PASSWORD=password

It should be hidden similarly as it was in OSE2 - add there a small '(show)' link that would reveal password only when clicked.

Comment 2 Wei Sun 2015-06-19 06:33:23 UTC
This is more like a future request.Since the password is only seen by the users who could access the project or the users who could view some specified database resources ,the password is not seen by others who do not have the permission to view the password.
So I think it's acceptable.

Comment 3 Jessica Forrester 2016-11-17 18:46:26 UTC
You should use Secrets for passwords, this would prevent exposure of passwords in env vars.  Secret values are only visible after the user chooses to reveal the values.

Our OOTB templates need to be doing this as well.

Comment 5 Justin Pierce 2016-11-30 13:55:44 UTC
https://github.com/openshift/origin/pull/12055

Comment 6 XiuJuan Wang 2017-03-23 08:05:12 UTC
The below pre-installed tempaltes still show password through environment variables after create in webconsole

redis-ephemeral
redis-persistent
amq62-basic
amq62-persistent
amq62-persistent-ssl
amq62-ssl
eap64-amq-persistent-s2i
eap64-amq-s2i
eap64-basic-s2i
eap64-https-s2i
eap64-mongodb-persistent-s2i
eap64-mongodb-s2i
eap64-mysql-persistent-s2i
eap64-mysql-s2i
eap64-postgresql-persistent-s2i
eap64-postgresql-s2i
eap64-sso-s2i
eap70-amq-persistent-s2i
eap70-amq-s2i
eap70-basic-s2i
eap70-https-s2i
eap70-mongodb-persistent-s2i
eap70-mongodb-s2i
eap70-mysql-persistent-s2i
eap70-mysql-s2i
eap70-postgresql-persistent-s2i
eap70-postgresql-s2i
eap70-sso-s2i
jws30-tomcat7-basic-s2i
jws30-tomcat7-https-s2i
jws30-tomcat7-mongodb-persistent-s2i
jws30-tomcat7-mongodb-s2i
jws30-tomcat7-mysql-persistent-s2i
jws30-tomcat7-mysql-s2i
jws30-tomcat7-postgresql-persistent-s2i
jws30-tomcat7-postgresql-s2i
jws30-tomcat8-basic-s2i
jws30-tomcat8-https-s2i
jws30-tomcat8-mongodb-persistent-s2i
jws30-tomcat8-mongodb-s2i
jws30-tomcat8-mysql-persistent-s2i
jws30-tomcat8-mysql-s2i
jws30-tomcat8-postgresql-persistent-s2i
jws30-tomcat8-postgresql-s2i

Comment 7 Ben Parees 2017-03-23 12:09:08 UTC
I'll fix the redis template but the other templates are owned by the middleware team, so the bug needs to be filed against them to change the template structure to match our new secret pattern.

Comment 8 Ben Parees 2017-03-23 12:17:53 UTC
fixing redis here: 
https://github.com/openshift/origin/pull/13528

Comment 9 Ben Parees 2017-03-23 12:19:07 UTC
Rob, head's up about some (suggested) changes for the middleware templates.  By using a secret to provide the password env variable, the web console will understand to not display the value.

You can see an example of the change here:
https://github.com/openshift/origin/pull/13528

Comment 10 openshift-github-bot 2017-03-23 22:58:13 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/cbe2807ef2d831e67fb9b4e4df1def619ebdf22a
use secret refs for redis password value so it is not exposed on the console

bug 1233513

Comment 11 Troy Dawson 2017-04-11 21:07:27 UTC
This has been merged into ocp and is in OCP v3.6.27 or newer.

Comment 13 XiuJuan Wang 2017-04-14 03:12:02 UTC
Since the xpaas templates already have issue 'JBoss Issue Tracker CLOUD-1511' to track, I will ingore them from this bug.

There is new template dotnet-pgsql-persistent [1] added recently,we also should cover this template.

[1] https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v1.6/quickstart-templates/dotnet-pgsql-persistent.json

Comment 14 Ben Parees 2017-04-14 03:24:27 UTC
Scott I see you added the template mentioned in comment 13.  Do you know who the actual owner of the template is so we can assign a bug to them?

Comment 15 Scott Dodson 2017-04-17 13:13:33 UTC
Severin Gehwolf owns the dotnet templates.

Comment 16 Scott Dodson 2017-04-17 13:15:02 UTC
https://github.com/redhat-developer/s2i-dotnetcore is the upstream repo

Comment 17 Severin Gehwolf 2017-04-18 09:13:52 UTC
Yes, we'll look to get this fixed. Thanks.

Comment 18 Severin Gehwolf 2017-04-20 13:28:48 UTC
Upstream PR:
https://github.com/redhat-developer/s2i-dotnetcore/pull/69

Comment 22 Severin Gehwolf 2017-04-24 13:13:32 UTC
Assigning back to Scott. .NET templates are fixed upstream.

Comment 26 XiuJuan Wang 2017-04-25 07:08:55 UTC
Password is still shown in webconsole when create app with [1] template

[1] https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v1.5/quickstart-templates/dotnet-pgsql-persistent.json

Comment 27 Severin Gehwolf 2017-04-25 09:07:56 UTC
(In reply to XiuJuan Wang from comment #26)
> Password is still shown in webconsole when create app with [1] template
> 
> [1]
> https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/
> openshift_examples/files/examples/v1.5/quickstart-templates/dotnet-pgsql-
> persistent.json

Seems the wrong template to test. PR above merged it into the release-1.5 branch *not* master. Looks like master does not have it yet. Scott, thoughts? Anyway the template to test is here:

https://raw.githubusercontent.com/openshift/openshift-ansible/release-1.5/roles/openshift_examples/files/examples/v1.5/quickstart-templates/dotnet-pgsql-persistent.json

Comment 28 XiuJuan Wang 2017-04-25 09:22:56 UTC
@Severin,My mistake.
Checked the template under branch release-1.5, password is hidden in webconsole.
Move bug to verified.

Comment 29 Scott Dodson 2017-04-25 12:18:37 UTC
Master branch PR is here, i'll get it merged today. The CI jobs were busted for a while.

https://github.com/openshift/openshift-ansible/pull/3962

Comment 31 errata-xmlrpc 2017-04-25 17:41:35 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/RHBA-2017:1140


Note You need to log in before you can comment on or make changes to this bug.