If passwords are used for authentication, MongoDB must store only hashed, salted representations of passwords.

From MongoDB Enterprise Advanced 3.x Security Technical Implementation Guide

Part of SRG-APP-000171-DB-000074

Associated with: CCI-000196

SV-96581r1_rule If passwords are used for authentication, MongoDB must store only hashed, salted representations of passwords.

Vulnerability discussion

The DoD standard for authentication is DoD-approved PKI certificates.Authentication based on User ID and Password may be used only when it is not possible to employ a PKI certificate, and requires AO approval.In such cases, database passwords stored in clear text, using reversible encryption, or using unsalted hashes would be vulnerable to unauthorized disclosure. Database passwords must always be in the form of one-way, salted hashes when stored internally or externally to MongoDB.

Check content

MongoDB supports x.509 certificate authentication for use with a secure TLS/SSL connection. The x.509 client authentication allows clients to authenticate to servers with certificates rather than with a username and password. If X.509 authentication is not used, a SCRAM-SHA-1 authentication protocol is also available. The SCRAM-SHA-1 protocol uses one-way, salted hash functions for passwords as documented here: https://docs.mongodb.com/v3.4/core/security-scram-sha-1/ To authenticate with a client certificate, you must first add a MongoDB user that corresponds to the client certificate. See Add x.509 Certificate subject as a User as documented here: https://docs.mongodb.com/v3.4/tutorial/configure-x509-client-authentication/ To authenticate, use the db.auth() method in the $external database, specifying "MONGODB-X509" for the mechanism field, and the user that corresponds to the client certificate for the user field. If the mechanism field is not set to "MONGODB-X509", this is a finding.

Fix text

Do the following: - Create local CA and signing keys. - Generate and sign server certificates for member authentication. - Generate and sign client certificates for client authentication. - Start MongoDB cluster in non-auth mode. - Set up replica set and initial users. - Restart MongoDB replica set in X.509 mode using server certificates. Example shown here for x.509 Authentication: https://www.mongodb.com/blog/post/secure-mongodb-with-x-509-authentication Additionally, SSL/TLS must be on as documented here: https://docs.mongodb.com/v3.4/tutorial/configure-ssl/

Pro Tips

Lavender hyperlinks in small type off to the right (of CSS class id, if you view the page source) point to globally unique URIs for each document and item. Copy the link location and paste anywhere you need to talk unambiguously about these things.

You can obtain data about documents and items in other formats. Simply provide an HTTP header Accept: text/turtle or Accept: application/rdf+xml.

Powered by sagemincer