Check mongodb localhost bypass¶
Description¶
This advisor returns a warning if the localhost exception is enabled in MongoDB ( the enableLocalhostAuthBypass parameter is set to True).
This represents a security vulnerability and should be disabled.
For more information, see the MongoDB documentation.
Rule¶
MONGODB_GETPARAMATER
db.adminCommand({'getParameter':'*'}).enableLocalhostAuthBypass
true
enableLocalhostAuthBypass = docs[0]["enableLocalhostAuthBypass"]
print(repr(enableLocalhostAuthBypass))
if enableLocalhostAuthBypass == "true":
Resolution¶
Follow the steps below to disable localhost exception:
-
Edit the
mongod.confand set the below parameter.setParameter: enableLocalhostAuthBypass: false -
Roll-restart your
mongodnodes to apply the changes.
Need more support from Percona?¶
Percona experts bring years of experience in tackling tough database performance issues and design challenges.