V-279383
SV-279383r1179483_rule
CAT II
MongoDB must require users to reauthenticate when organization-defined circumstances or situations require reauthentication.
From: MongoDB Enterprise Advanced 8.x Security Technical Implementation Guide (V1R1)
Description
<VulnDiscussion>The DOD standard for authentication of an interactive user is the presentation of a common access card (CAC) or other physical token bearing a valid, current, DOD-issued Public Key Infrastructure (PKI) certificate, coupled with a Personal Identification Number (PIN) to be entered by the user at the beginning of each session and whenever reauthentication is required.
Without reauthentication, users may access resources or perform tasks for which they do not have authorization.
When applications provide the capability to change security roles or escalate the functional capability of the application, it is critical the user reauthenticate.
In addition to the reauthentication requirements associated with session locks, organizations may require reauthentication of individuals and/or devices in other situations, including (but not limited to) the following circumstances:
(i) When authenticators change;
(ii) When roles change;
(iii) When security categories of information systems change;
(iv) When the execution of privileged functions occurs;
(v) After a fixed period of time; or
(vi) Periodically.
Within the DOD, the minimum circumstances requiring reauthentication are privilege escalation and role changes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>
Check Procedure
In MongoDB, a user can reauthenticate by explicitly logging out and then logging back in with the db.logout() and db.auth() commands, respectively.
The steps to accomplish this would typically depend on the environment and interface, for example, shell, driver, or MongoDB Atlas.
Log out of the current session using the db.logout() command.
Run the following command from the database the user has authenticated from (example below uses "test" as the authentication database):
> use test
> db.logout()
Example output:
{ ok: 1 }
If the above output is not displayed upon logout, this is a finding.
Log back in, using the db.auth() command:
> use test
> db.auth({
user: '<username>',
pwd: '<password>'
})
Example output:
{ ok: 1 }
If the above output is not displayed upon login, this is a finding.
Fix Text
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: "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.
More information can be found here:
https://www.mongodb.com/docs/v8.0/reference/command/createUser/
https://www.mongodb.com/docs/v8.0/reference/command/createRole/
CCI Reference
CCI-002038- Created
- 2026-04-07 20:08:22
- Last Updated
- 2026-04-07 20:08:22