Reputation: 3870
I am discovering MongoDb and I realize that I can access my database from anywhere using mongodb compass just by entering my database URI and click connect.
So basically, If someone has the URI of my database, he can access it and do whatever he wants ?
How to avoid this by for example, password protect it ?
Upvotes: 0
Views: 473
Reputation: 59456
Yes, by default MongoDB does not use authorization. Enable it in the configuration file:
security:
authorization: enabled
see Configuration File Options security.authorization
Upvotes: 1
Reputation: 22956
Then only authenticated user can access the database
Upvotes: 1