Score:0

MongoDB authentication instance without cluster i.e. using mongos router without a sharded cluster?

de flag

So my question is:
Is there a possibility to have something like a Mongo authentication instance running on a VPS, together with fail2ban, which only forwards authenticated requests to a home server MongoDB? The trouble of setting up a whole shared cluster in order to be able to use the mongos router seems a bit overkill for my hobby purpose.

My setup:
I have a home server (no public IP) and a hosted VPS (public IP) both running Ubuntu 22. They are connected via a WireGuard VPN. My MongoDB instance is running on my home server (the vps has very limited storage). Sadly, from my (Windows) Work Laptop I can not connect to the VPN as I am not allowed to install WireGuard (we only have FortiClient available). During Business Trips, I only take that Laptop and also use it for my hobby projects. Nothing fancy, just some python web crawler scripting. There is also nothing important in the DB, hence it's a single instance, no replica set or cluster.

Until recently, I used rinetd to forward a port on my VPS to the MongoDB on my home server through the VPN. The mongodb is password protected. However, the last weeks I have seen a lot of unauthorized access attempts. So much that I temporarily removed the forwarding and installed fail2ban. Sadly I cannot use fail2ban on my homeserver for the mongodb because of the forwarding on the VPS, all access to the mongodb seems to come directly from my VPS and I would just lock myself out. Currently, I am running a VM on the Laptop in order to connect to the VPN, but this is incredibly unperformant and no fun to work with.

Any ideas on how to solve this? I appreciate all suggestions.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.