MongoDB DBA User Authentication and Authorization Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Thames
T
Thames
Community Contributor
Quizzes Created: 11982 | Total Attempts: 187,298
| Attempts: 11 | Questions: 20 | Updated: Aug 16, 2026
Please wait...
Question 1 / 21
🏆 Rank #-- ▾
0 %
0/100
Score 0/100

1. How does MongoDB handle password storage for SCRAM authentication?

Explanation

MongoDB does not store users’ passwords in plain text for SCRAM authentication. It uses a salt and a cryptographic hash to derive stored credentials, helping protect passwords if the credential data is exposed. During authentication, SCRAM verifies the user’s proof without sending the password itself over the connection.

Submit
Please wait...
About This Quiz
MongoDB DBA User Authentication and Authorization Quiz - Quiz

This quiz assesses your understanding of MongoDB user authentication and authorization mechanisms essential for database administrators. You will be tested on user creation, role-based access control (RBAC), authentication methods, privilege management, and security best practices. Mastering these concepts is critical for securing MongoDB deployments and protecting sensitive data in production... see moreenvironments. see less

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. What is the primary advantage of using role-based access control in MongoDB?

Explanation

Role-based access control assigns permissions to roles rather than individual users. Administrators can grant roles to users, making it easier to manage, delegate, and update access consistently as security needs change.

Submit

3. To remove a user from MongoDB, which method would you use?

Explanation

MongoDB’s `db.dropUser()` method removes a specified user from the current database’s user list. It is typically called with the username, such as `db.dropUser("alice")`, and returns a status indicating whether the operation succeeded. The user must have appropriate privileges to perform this administrative action. The other listed methods are not standard MongoDB commands for dropping a database user.

Submit

4. Which authentication method encrypts credentials during transmission?

Explanation

SCRAM-SHA-256 uses a challenge-response exchange, so the password itself is not sent directly. When combined with TLS, the connection is encrypted, protecting authentication data and other traffic from interception during transmission. Plain-text authentication lacks this protection unless secured by TLS, while session-based tokens and MongoDB’s challenge protocol do not describe this same combination.

Submit

5. What is the correct syntax to update a user's password in MongoDB?

Explanation

Use `db.updateUser()` to modify an existing user’s settings. Pass the username as the first argument and an object containing the new password in the `pwd` field as the second argument: `db.updateUser(username, { pwd: password })`.

Submit

6. In MongoDB, can custom roles inherit permissions from other roles?

Explanation

Custom roles can inherit privileges from other roles in MongoDB. This lets administrators combine existing permissions with additional privileges, making access control easier to manage without recreating every permission from scratch.

Submit

7. Which role allows a user to view and modify user and role definitions?

Explanation

The `userAdmin` role lets a user manage user accounts and role definitions within a specific database. This includes viewing and creating users and roles, changing their settings, and assigning or removing roles. Unlike `userAdminAnyDatabase`, its permissions are limited to the database where it is granted.

Submit

8. What does x.509 certificate authentication primarily rely on?

Explanation

X.509 certificate authentication primarily identifies and verifies a client using information in its certificate, including the Distinguished Name (DN). The certificate is validated against a trusted certificate authority, allowing the system to authenticate the client without relying on passwords or API keys.

Submit

9. To enable authentication on an existing MongoDB instance, what must be configured?

Explanation

Authentication is enabled by setting `security.authorization` to `enabled` in the MongoDB server configuration file, `mongod.conf`. After updating the configuration, restart the MongoDB service for the change to take effect.

Submit

10. Which of the following is a database-level role in MongoDB?

Explanation

The `dbOwner` role applies to a specific database and combines the privileges of `readWrite`, `dbAdmin`, and `userAdmin` on that database, allowing a user to manage its data, configuration, and users. By contrast, `clusterMonitor` and `readWriteAnyDatabase` are cluster-wide roles, while `restore` is intended for restore operations rather than general database ownership.

Submit

11. Which authentication mechanism does MongoDB use by default for replica sets?

Explanation

MongoDB uses SCRAM-SHA-256 as its default password-based authentication mechanism. It verifies credentials through a challenge-response exchange rather than sending the password directly. Kerberos, LDAP, and x.509 authentication are supported alternatives but require additional configuration. For authentication between replica-set members, MongoDB instead uses keyfiles or x.509 certificates.

Submit

12. What is the purpose of the 'backup' built-in role?

Submit

13. Which command would you use to grant an additional role to an existing user?

Explanation

`db.grantRolesToUser()` adds one or more roles to an existing MongoDB user without replacing the user’s current roles. Use it with the username and the roles to grant.

Submit

14. The 'clusterAdmin' role grants permissions at which scope?

Explanation

The `clusterAdmin` role provides administrative privileges across a MongoDB cluster, including managing cluster-wide resources and operations. Its permissions apply to the deployment as a whole, rather than being limited to a specific database or collection.

Submit

15. In role-based access control, what does a privilege consist of?

Explanation

A privilege in role-based access control specifies which resource a user may access and which actions they are allowed to perform on it. Roles group these privileges and assign them to users.

Submit

16. Which authentication method is recommended for enterprise deployments with existing directory services?

Explanation

LDAP is recommended for enterprise deployments that already use directory services because it lets applications authenticate users against centralized directories such as Active Directory or OpenLDAP. This reuses existing accounts and access policies, supports centralized administration, and avoids maintaining separate credentials for each application. SCRAM methods are password-based mechanisms, while X.509 uses certificates rather than integrating directly with a directory.

Submit

17. What does the db.createUser() method require as mandatory parameters?

Explanation

The `db.createUser()` method accepts a user document that specifies the account’s username, password, and assigned roles. The roles determine the permissions the account receives in the database. Providing these details lets MongoDB create the user and define how they authenticate and what operations they can perform.

Submit

18. To create a user in MongoDB, which database should you authenticate against?

Explanation

MongoDB user creation is typically performed while authenticated against the `admin` database, which manages users and roles across the deployment. The user’s assigned roles can then grant access to specific databases, including the target database.

Submit

19. Which built-in role grants read and write permissions on all databases?

Explanation

The `root` role provides broad administrative privileges across the MongoDB deployment, including read and write access to all databases. By contrast, `readWrite` and `dbOwner` are generally limited to a specific database, while `admin` is a database name rather than the built-in role described here.

Submit

20. In MongoDB, what is the primary function of a role?

Explanation

In MongoDB, a role groups privileges that determine which actions a user can perform on specific databases or resources. Administrators assign roles to grant appropriate access, such as reading data or managing collections. Roles support access control and least privilege; they do not store passwords, encrypt network traffic, or monitor performance.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
How does MongoDB handle password storage for SCRAM authentication?
What is the primary advantage of using role-based access control in...
To remove a user from MongoDB, which method would you use?
Which authentication method encrypts credentials during transmission?
What is the correct syntax to update a user's password in MongoDB?
In MongoDB, can custom roles inherit permissions from other roles?
Which role allows a user to view and modify user and role definitions?
What does x.509 certificate authentication primarily rely on?
To enable authentication on an existing MongoDB instance, what must be...
Which of the following is a database-level role in MongoDB?
Which authentication mechanism does MongoDB use by default for replica...
What is the purpose of the 'backup' built-in role?
Which command would you use to grant an additional role to an existing...
The 'clusterAdmin' role grants permissions at which scope?
In role-based access control, what does a privilege consist of?
Which authentication method is recommended for enterprise deployments...
What does the db.createUser() method require as mandatory parameters?
To create a user in MongoDB, which database should you authenticate...
Which built-in role grants read and write permissions on all...
In MongoDB, what is the primary function of a role?
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!