Project: Allow MongoDB to run without authentication

Created on 18 Feb 2019  路  2Comments  路  Source: kubedb/project

There should be an option to run a MongoDB instance without authentication (I-know-what-I-am-doing kind of opt-in) to accomodate existing workflows e.g. in testing environments. The simplest way to do it would be to replace --auth with --transitionToAuth in the StatefulSet definition when some parameter is set on the CRD.

dmongodb security

Most helpful comment

I have been able to workaround like this:

apiVersion: kubedb.com/v1alpha1
kind: MongoDB
metadata:
  name: test-mongodb
spec:
  version: "3.6-v1"
  replicas: 3
  replicaSet:
    name: test
  podTemplate:
    spec:
      args:
      - --transitionToAuth
  storage:
[...]

It results in both --auth and --transitionToAuth being on the command line, which doesn't seem to bother mongod, while it accepts the latest argument, which is --transitionToAuth, as intended.

Feel free to close the ticket since we now have a workaround. An actual implementation might make sense, but that's not for me to decide.

All 2 comments

I have been able to workaround like this:

apiVersion: kubedb.com/v1alpha1
kind: MongoDB
metadata:
  name: test-mongodb
spec:
  version: "3.6-v1"
  replicas: 3
  replicaSet:
    name: test
  podTemplate:
    spec:
      args:
      - --transitionToAuth
  storage:
[...]

It results in both --auth and --transitionToAuth being on the command line, which doesn't seem to bother mongod, while it accepts the latest argument, which is --transitionToAuth, as intended.

Feel free to close the ticket since we now have a workaround. An actual implementation might make sense, but that's not for me to decide.

Adding my two cents here: this will work only with replica set. Trying this on single node will lead to this error: BadValue: --transitionToAuth must be used with keyFile or x509 authentication

Was this page helpful?
0 / 5 - 0 ratings

Related issues

botzill picture botzill  路  5Comments

DamiaPoquet picture DamiaPoquet  路  3Comments

LinAnt picture LinAnt  路  5Comments

tamalsaha picture tamalsaha  路  7Comments

david-ecc picture david-ecc  路  5Comments