1

I have been reading up on the security of MongoDB. If my web app lives on the same server as the DB, can I just set the bindIP to 127.0.0.1? I'm not sure what the best practices are, but this should only allow the actual machine to access the DB right?

1 Answer 1

0

That's right, if there will be local binding only local connection could be made.

This could target overall performance - but this is other topic.

Don't forget to enable authentication - as a base security settings.

From comments :

When was thinking about performance then I had in mind running application server and mongo on same server.

4
  • If performance is something that is required, how much of a loss would I be facing by changing the bind ip to 127.0.0.1?
    – Aaron
    Commented May 27, 2016 at 16:58
  • @Aaron bindIP is unrelated to performance; this setting only determines the network interface(s) the mongod server is listening to.
    – Stennie
    Commented May 28, 2016 at 0:17
  • When was thinking about performance then I had in mind running application server and mongo on same server.....
    – profesor79
    Commented May 28, 2016 at 8:12
  • 1
    @profesor79 Thanks for clarifying: a warning on running app & database server together is sensible as both processes will both be competing for the same resources. Running all locally will save network traffic if the server is adequately provisioned or just for dev, but is likely to cause performance problems under higher load. For security best practices I would also recommend the checklist in the MongoDB manual: docs.mongodb.com/manual/administration/security-checklist.
    – Stennie
    Commented May 31, 2016 at 23:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.