SV-279372r1179475_rule
V-279372
SRG-APP-000328-DB-000301
MD8X-00-006500
CAT II
10
Enable authentication for MongoDB by following the instructions here:
https://www.mongodb.com/docs/v8.0/tutorial/enable-authentication/
Create an administrative user in MongoDB:
use admin
db.createUser(
{
user: < username >,
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/v8.0/reference/command/createUser/
https://www.mongodb.com/docs/v8.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-279372
False
MD8X-00-006500
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
5728