Avoid issuing commands upon connection where the user is unauthorized to execute them
Presently when a user connects to a MongoDB cluster mongosh will execute several command helpers. Unless the users have specific privileges these commands will trigger several unauthorised messages similar to below:
{"msg":"Checking authorization failed","attr":{"error":{"code":13,"codeName":"Unauthorized","errmsg":"not authorized on admin to execute command { getParameter: 1, featureCompatibilityVersion: 1, apiVersion: \"1\"... $db: \"admin\" }"}}}
This causes issues for some security monitoring applications, and requires the security monitoring application to be filtered to ignore these events.
A similar issue is described in the Jira ticket: https://jira.mongodb.org/browse/MONGOSH-1298
1
vote
![](https://secure.gravatar.com/avatar/02e86d4a618e7f86a2ecc1e75f4fb079?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)