A few months ago I started production mongodb server on ubuntu 18.04 secured with SSL (https access) with following UFW rules setup
ufw allow 127017 ufw allow 127017/tcp
No user authentication configured for mongodb. Also no change was made to mongod.conf. This is the line in mongo.conf:
# network interfaces net: port: 27017 bindIp: 127.0.0.1
that I am betting on saved me from data hack. This line says only connections from localhost are allowed to mongodb server.
Assume that hacker is not able to login to my remote server and the only thing he came to know that I have mongodb running and port 127017 is open, is it safe to assume that my mongo data was safe?
I have now changed UFW rules to allow access to 127017 only tfrom my desktop IP address and updated mongod.conf to allow access from my desktop as well as from localhost.