Home > database >  Need information on MongoDB security config options - MongoDB 4.2
Need information on MongoDB security config options - MongoDB 4.2

Time:08-18

I have replica set of MongoDB v4.2 with 3 servers running. In my mongod.conf file, until now I have below options configured for security config section. Authorization is not enabled as per config file, but if I want to access mongo shell then I need to authenticate myself using username and password, not sure how if authorization is not enabled.

security:
  keyFile: /var/lib/mongo/mongokey

Now, I want to include below 2 new fields into config file under security section. So what is difference between mongokey file provided in keyFile section and below clusterAuth keyFile or sendKeyFile values. If I use keyFile or sendKeyFile under clusterAuth, what will happen ? Mongodb documentation is not clear enough to find difference for these options.

security:
  keyFile: /var/lib/mongo/mongokey
  authorization: enabled
  clusterAuthMode: keyFile or sendKeyFile

CodePudding user response:

Declaring a keyFile enables user authentication.

Enforcing internal authentication also enforces user access control.

Update Replica Set to Keyfile Authentication

  • Related