MongoDB Questions and Answers – Authorization

«
»

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Authorization”.

1. MongoDB employs _________ to govern access to a MongoDB system.
a) RBAS
b) RBAC
c) RBCC
d) None of the mentioned
View Answer

Answer: b
Explanation: RBAC stands for Role-Based Access Control.

advertisement

2. Point out the correct statement.
a) MongoDB provides built-in roles, each with a dedicated purpose for a common use case
b) MongoDB does not enable authorization by default
c) Administrators also can create new roles and privileges to cater to operational needs
d) All of the mentioned
View Answer

Answer: b
Explanation: You can enable authorization using the –auth or the –keyFile options, or if using a configuration file, with the security.authorization or the security.keyFile settings.

3. __________ consists of a specified resource and the actions permitted on the resource.
a) privilege
b) action
c) command
d) right
View Answer

Answer: a
Explanation: A privilege resource is either a database, collection, set of collections, or the cluster.

advertisement
advertisement

4. _________ provides all the privileges of the read role.
a) delete
b) update
c) readWrite
d) none of the mentioned
View Answer

Answer: c
Explanation: The role provides the ability to modify data on all non-system collections and the system.js collection.

5. Point out the wrong statement.
a) When granted a role, a user receives all the privileges of that role
b) A role consists of privileges that pair resources with not allowed operations
c) User cannot have several roles in MongoDB
d) None of the mentioned
View Answer

Answer: c
Explanation: A user can have several roles concurrently, in which case the user receives the union of all the privileges of the respective roles.

advertisement

6. MongoDB stores user credentials in the protected admin.system._________
a) user
b) capped
c) cappeduser
d) users
View Answer

Answer: d
Explanation: The admin.system.users collection stores the user’s authentication credentials as well as any roles assigned to the user.

7. You must have the _______ action on a database to create a new user on that database.
a) createUser
b) createSuperUser
c) createSuUser
d) all of the mentioned
View Answer

Answer: a
Explanation: To provide user administrators, MongoDB has userAdmin and userAdminAnyDatabase roles.

advertisement

8. Data of <database>.system.indexes can be accessed using ____________
a) listallIndexes
b) listIndexes
c) ViewIndexes
d) SelectIndexes
View Answer

Answer: b
Explanation: Kerberos is an industry standard authentication protocol for large client/server systems.

9. You must have the __________ action on a role’s database to grant the role to another user.
a) grantRole
b) grantRoleAdm
c) grantRolePrivilege
d) none of the mentioned
View Answer

Answer: a
Explanation: listIndexes returns information about the indexes on the specified collection.

advertisement

10. Command listIndexes.ok returning value 1 indicates ______________
a) failure
b) success
c) abnormal exit
d) none of the mentioned
View Answer

Answer: b
Explanation: A value of 1 indicates success.

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Reference Books in MongoDB.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter