pmm-agent's connection checker does not check authentication for MongoDB

Description

pmm-agent's connection checking allows connections without username and password when MongoDB is running with --auth.

Since PMM is about monitoring databases, I think pmm-agent should check that this is possible:

In the same time, it still should work with --noauth, so many different combinations should be tested.

Implementation was drafted at https://github.com/percona/pmm-agent/pull/170. It should be finished and tested.

Testing Instruction: 

Check with the latest version for official MongoDB and PSMDB both, with Authentication enabled. 

How to test

None

How to document

None

Smart Checklist

Activity

Show:

Maksym Hilliaka December 23, 2020 at 9:45 AM

 I will make it

Alexey Palazhchenko December 23, 2020 at 9:43 AM

Please make a feature build to pass it to QA

Akira Kurogane June 8, 2020 at 8:29 AM

Hi Alexey. Your conclusion that pmm-agent should check a command like listDatabases or serverStatus is correct.

I guess the pmm-admin add action is currently evaluating 'OK' just on being able to establish a connection, but it should try one of those commands - I suggest listDatabases as being the simplest command that definitely requires authorization before it will work.

For some background: A connection to mongod/mongos is allowed without providing a user and password. It's an intermediate step before you proceed to executing the auth() command. Also it allows the drivers to run certain auth-free commands like isMaster, isdbgrid (= 'is this a mongos node'), buildInfo (eg. version) which I assume is a requirement for them.

Alexey Palazhchenko June 5, 2020 at 1:24 PM

any thoughts on that?

Done

Details

Assignee

Reporter

Priority

Components

Needs QA

Yes

Fix versions

Story Points

Sprint

Smart Checklist

Created June 5, 2020 at 1:10 PM
Updated March 6, 2024 at 4:19 AM
Resolved January 11, 2021 at 6:40 PM