3.4 Ensure that each role for each MongoDB database is needed and grants only the necessary privileges

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

Information

Reviewing all roles periodically and eliminating unneeded roles as well as unneeded privileges from necessary roles helps minimize the privileges for each user.

Rationale:

Although role-based access control (RBAC) has many advantages for regulating access to resources, over time, some roles may no longer be needed, and some roles may grant privileges that are no longer needed.

NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance.

Solution

Revoke specified privileges from the user-defined role on the database where the command is run. The revokePrivilegesFromRole command has the following syntax:

{
revokePrivilegesFromRole: '<role>',
privileges:
[
{ resource: { <resource> }, actions: [ '<action>', ... ] },
...
],
}

References:

https://docs.mongodb.com/v3.6/reference/method/db.revokePrivilegesFromRole/

https://docs.mongodb.com/v3.6/reference/method/db.revokePrivilegesFromRole/#db.revokePrivilegesFromRole

Notes:

You must have the dropRole action on a database to drop a role from that database.

See Also

https://workbench.cisecurity.org/files/2605