SV-265935r1031272_rule
V-265935
SRG-APP-000328-DB-000301
MD7X-00-006700
CAT II
10
Enable authentication for MongoDB by following the instructions here: https://www.mongodb.com/docs/v7.0/tutorial/enable-authentication/
Create an administrative user in MongoDB:
use admin
db.createUser(
{
user: "UserAdmin",
pwd: passwordPrompt(), // or cleartext password
roles: [
{ role: "userAdminAnyDatabase", db: "admin" },
{ role: "readWriteAnyDatabase", db: "admin" }
]
}
)
Enable authorization by adding the following entry to the MongoDB configuration file:
security:
authorization: enabled
Restart the MongoDB service from the OS.
$ sudo systemctl restart mongod
The "UserAdmin" user created above can use the "createUser" and "createRole" MongoDB commands to add the required users and roles per organizational- or site-specific documentation.
https://www.mongodb.com/docs/v7.0/reference/command/createUser/
https://www.mongodb.com/docs/v7.0/reference/command/createRole/
Review the MongoDB Configuration file (default location: /etc/mongod.conf).
If the file does not contain the following entry, this is a finding:
security:
authorization: enabled
V-265935
False
MD7X-00-006700
Review the MongoDB Configuration file (default location: /etc/mongod.conf).
If the file does not contain the following entry, this is a finding:
security:
authorization: enabled
M
5637