Bug 1358832 - Enable mongodb authentication
Summary: Enable mongodb authentication
Alias: None
Product: Red Hat Storage Console
Classification: Red Hat
Component: core
Version: 2
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 2
Assignee: Shubhendu Tripathi
QA Contact: Martin Kudlej
Depends On:
Blocks: Console-2-Async
TreeView+ depends on / blocked
Reported: 2016-07-21 14:56 UTC by Lubos Trilety
Modified: 2016-10-19 15:20 UTC (History)
8 users (show)

Fixed In Version: rhscon-core-0.0.44-1.el7scon.x86_64
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2016-10-19 15:20:46 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Gerrithub.io 284854 0 None None None 2016-08-02 11:06:44 UTC
Gerrithub.io 296095 0 None None None 2016-09-30 06:47:36 UTC
Red Hat Product Errata RHSA-2016:2082 0 normal SHIPPED_LIVE Moderate: Red Hat Storage Console 2 security and bug fix update 2017-04-18 19:29:02 UTC

Description Lubos Trilety 2016-07-21 14:56:54 UTC
Description of problem:
Currently mongodb authentication is switched off. If I change it to on, skyring service cannot connect to db and it fails to start. However in the configuration of skyring there's correct user and password for the db.

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

How reproducible:

Steps to Reproduce:
1. Stop skyring and mongod service if needed
2. Modify /etc/mongodb.conf, add or un-comment 'auth=yes' line
3. Start mongod service
4. Check that /etc/skyring/skyring.conf has correct credentials for the db
5. Try to start skyring service

Actual results:
Skyring fails to start

# journalctl -xe
-- Unit skyring.service has begun starting up.
čec 21 16:30:36 dhcp46-15.lab.eng.blr.redhat.com skyring-pre.sh[10655]: MongoDB shell version: 2.6.5
čec 21 16:30:36 dhcp46-15.lab.eng.blr.redhat.com skyring-pre.sh[10655]: connecting to: skyring
čec 21 16:30:36 dhcp46-15.lab.eng.blr.redhat.com skyring-pre.sh[10655]: 2016-07-21T16:30:36.403+0200 Error: couldn't add user: not authorized on skyring to execute command { createUser: "admin", pwd: "xxx", roles: [ "readWrite", "dbAdmin"

Expected results:
skyring should be able to connect to the db if it has correct credentials set

Additional info:
Could be a security issue that mongodb authentication is disabled.

Comment 1 Shubhendu Tripathi 2016-07-21 15:44:43 UTC
Looking at this, I can make out that we should enable authentication once skyring-pre.sh is executed.
Tim, can you check and add this as part of skyring-pre.sh only? So that just after installation of skyring, once admin user is created, the authentication would be set as Yes for mongodb.

Comment 2 Timothy Asir 2016-09-28 18:10:21 UTC
Security flag will be added after creating db-admin user first time.
Patch sent to upstream for review: https://review.gerrithub.io/#/c/286696/2

Comment 4 Martin Kudlej 2016-10-04 12:25:22 UTC
Tested with 
and it works as excepted. --> VERIFIED

Comment 6 errata-xmlrpc 2016-10-19 15:20:46 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.


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