DISA STIGS Viewer

MongoDB must enforce discretionary access control (DAC) policies, as defined by the data owner, over defined subjects and objects.

Overview

Finding ID Version Rule ID IA Controls Severity
V-265935 MD7X-00-006700 SV-265935r1031272_rule   Medium
Description
DAC is based on the notion that individual users are "owners" of objects and therefore have discretion over who should be authorized to access the object and in which mode (e.g., read or write). Ownership is usually acquired as a consequence of creating the object or via specified ownership assignment. DAC allows the owner to determine who will have access to objects they control. An example of DAC includes user-controlled table permissions. When DAC policies are implemented, subjects are not constrained with regard to what actions they can take with information for which they have already been granted access. Thus, subjects that have been granted access to information are not prevented from passing (i.e., the subjects have the discretion to pass) the information to other subjects or objects. A subject that is constrained in its operation by Mandatory Access Control (MAC) policies is still able to operate under the less rigorous constraints of this requirement. Thus, while MAC imposes constraints preventing a subject from passing information to another subject operating at a different sensitivity level, this requirement permits the subject to pass the information to any subject at the same sensitivity level. The policy is bounded by the information system boundary. Once the information is passed outside of the control of the information system, additional means may be required to ensure the constraints remain in effect. While the older, more traditional definitions of discretionary access control require identity-based access control, that limitation is not required for this use of discretionary access control.
STIG Date
MongoDB Enterprise Advanced 7.x Security Technical Implementation Guide 2024-09-27

Details

Check Text (C-69853r1028589_chk)
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
Fix Text (F-69757r1031271_fix)
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/