Timeline for Allow connection to mongo only from my server droplet
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 1, 2023 at 7:25 | comment | added | JJussi | Your system is basically secure, because you use username and password. Nobody can get in, but you will get "knockers" to your MongoDB door, bots/persons who will try to get in, because they can see that there is MongoDB server. | |
Feb 28, 2023 at 2:42 | comment | added | Fernando |
Thanks. I realized my Nodejs app server doesn't have static IP address, as it is deployed on DigitalOcean via App Platform. I have to keep 27017 open to anywhere I guess. The net.bindIp setting is localhost,xxx.xxx.xx.xx (xxx.xxx.xx.xx is the server IP where is running the mongo instance). Everything is working fine, but I'm not sure if my server is secured. The security.authorization is enabled . The telnet response keeps me concerned (I've added an update just before the ufw status output to give more details about it).
|
|
Feb 27, 2023 at 18:36 | comment | added | JJussi | ...and with ufw you shoud have deny everthing from everywhere as last line. | |
Feb 27, 2023 at 18:34 | comment | added | JJussi | Your mongodb.conf says that port is 27017, so you open that port from outside to the mongodb server. And yes, that xxx.xxx.xx.xx is your nodejs app server IP; i.e. server what should have access to that DB server. You can have multiple allow from -lines for port 27017 with different source IPs | |
Feb 26, 2023 at 17:37 | comment | added | Fernando |
I also noticed DigitalOcean email telnet command says 27107 and all the MongoDB documentation on DigitalOcean says 27017 . Is it wrong? If I put telnet xxx.xxx.xx.xx 27017 looks like the connection is successfull, there's no output, but the console is cleaned
|
|
Feb 26, 2023 at 17:20 | comment | added | Fernando |
Thanks for your response. I just updated the last lines of my question. On ufw allow from xxx.xxx.xx.xx to any port 27017 I have to put my Nodejs app server IP and my local pc IP, right? Or am I missing something?
|
|
Feb 26, 2023 at 8:50 | history | answered | JJussi | CC BY-SA 4.0 |