j roc
j roc

Reputation: 238

Configuring mongoDB IP address for CRUD application

I'm creating a CRUD application, and I have a question regarding the IP address configuration.

I've allowed access from everywhere by setting access to 0.0.0.0/0, since I'm going to have users from all over the place interacting with the database. Does this cause a security issue?

Before anyone gets mad at me, I've looked through the docs trying to find an answer and this is the closest information I've found https://docs.atlas.mongodb.com/data-explorer and I'm also a beginner following a MDN tutorial but I wan't to make sure I configure everything the way it should be for a real project.

Upvotes: 0

Views: 119

Answers (1)

ROHIT KHURANA
ROHIT KHURANA

Reputation: 983

you need to follow below steps:

  • enable authentication first.
  • create customized role
  • create a user and password which will be able to do only allowed operations.

You can also whitelist specific IPs only with authenticationRestrictions option. Please find below links:

https://docs.mongodb.com/manual/reference/method/db.createUser/ https://www.softwaretestinghelp.com/mongodb/mongodb-create-user-assign-roles/

Upvotes: 1

Related Questions