Configure authentication feature on Database MongoDB

Tram Ho

MongoDB is a form of database software using the open source NoSQL, MongoDB works based on the concepts of Collection and Document. It has high performance along with good availability and easy scalability. The default installation of MongoDB ‘s authorization configuration is set to disabled by default, which means that any user connected to MongoDB’s port 27017 has full access to the database.

To protect this vulnerability, we will need to create an admin user, then we will enable authentication and connect in as the admin user to access the database.

Step 1: Adding an Administrative User

Step 2: Enabling Authentication

Step 3: Testing Authentication Setting

Access mongo

output: Do not display database information

Access mongo with the user just created step 1

output: Displays database information

So we have finished configuring the authentication feature on the MongoDB Database, you can use the administrative tools to connect. I am using NoSQLBooster tool to connect. You can create more databases, users, and permissions through the NoSQLBooster tool

image.png

image.png

 

Share the news now

Source : Viblo