Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require authentication #68

Open
boredland opened this issue Feb 12, 2024 · 4 comments
Open

Require authentication #68

boredland opened this issue Feb 12, 2024 · 4 comments

Comments

@boredland
Copy link

boredland commented Feb 12, 2024

I managed to run mongobetween between my mongodb replica and me, but wonder how if there's a way to secure that connection with a username/password.

As I understand the -username and -password options are to be only applied to the downstream connection. Is there a way? I basically would want the same password to be required, that is used to connect to the replica.

@ThatHurleyGuy
Copy link
Contributor

You're correct that the -usename/-password options are applied to the connection to the actual mongo cluster. There is not currently any mechanism built into mongobetween to provide authentication to connect to it. We run it as a sidecar, so it's only accessible on the physical host it's running on which negates the need to additional auth there. If you wanted to run it on a separate host, you'll need to either build that auth in at a higher level (locking it down at the network layer) or find a way to build the authentication into mongobetween itself. As for the latter, I don't think there's any easy mechanism to do that right now unfortunately

@boredland
Copy link
Author

boredland commented Mar 6, 2024

Do you think it is possible to add such a functionality to the proxy and would you accept a PR for that? I am missing any relevant GO-Skills, but perhaps someone could be found - so many people are stuck with MongoDB-Atlas & AWS Lambda for example. Many of them could profit from a little container with MongoBetween running in.

@kounat
Copy link
Contributor

kounat commented Jun 17, 2024

From your mention of AWS Lambda, I'm assuming your use case is within the AWS environment. If so, I would recommend leveraging security groups to restrict access to mongobetween instead of implementing authentication.

For example, I would assign the Lambda an empty security group, and on the EC2 instance that's running mongobetween, allow ingress from the Lambda's security group.

We'd certainly be open to a PR, but I would first suggest the above approach.

@boredland
Copy link
Author

boredland commented Jun 18, 2024

Sadly we're currently stuck with Vercel, a cloud provider which to my knowledge wraps lambda, but surely does not allow access to anything close to running a container or defining a security group.

Our team in particular has found a solution for now and likely will migrate to a setup where we can indeed security employ a sidecar with mongobetween. But the broader mongodb community could benefit of this great project anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants