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

Is there a way to detect bad credentials? #343

Open
nathanl opened this issue Aug 14, 2020 · 1 comment
Open

Is there a way to detect bad credentials? #343

nathanl opened this issue Aug 14, 2020 · 1 comment

Comments

@nathanl
Copy link
Contributor

nathanl commented Aug 14, 2020

The meow attack makes it seem good to check one's instances for weak login credentials. But that's not straightforward to do. This function call:

Mongo.start_link(
      url: "mongodb://#{hostname}:#{port}/admin",
      username: username,
      password: password
    )

...returns {:ok, pid} even if the credentials are wrong.

Is there a way to try a simple connection and get back an {:error, reason} if the credentials are not valid?

@tillsc
Copy link

tillsc commented Aug 10, 2021

Try {:ok, _v} = Mongo.ping(conn) after starting the link. This works for me

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

No branches or pull requests

2 participants