MongoDB MongoDB Security and Administration 1 — Questions and Answers
Question 1: What is role-based access control (RBAC) in MongoDB?
- Controlling access to collections based on document roles field
- A system where privileges are granted through roles assigned to users (Correct answer)
- A read-only access control system
- An automatic access control system based on IP roles
Correct answer: A system where privileges are granted through roles assigned to users
MongoDB's RBAC grants users privileges through roles, where each role defines a set of allowed actions on specified resources.
Question 2: Which built-in MongoDB role provides full administrative access to all databases?
- superUser
- dbOwner
- root (Correct answer)
- admin
Correct answer: root
The root role provides all privileges on all resources, giving unrestricted access to the entire MongoDB deployment.
Question 3: What does MongoDB's TLS/SSL configuration protect?
- Data at rest on disk
- Data in transit between clients and servers (Correct answer)
- Backup files during transfer
- Index data in memory
Correct answer: Data in transit between clients and servers
TLS/SSL encrypts network communications between MongoDB clients, servers, and replica set members to prevent eavesdropping and tampering.
Question 4: What is the purpose of the mongodump utility?
- Dumps performance statistics to a log file
- Creates a binary export of a MongoDB database or collection (Correct answer)
- Removes all documents from a collection
- Dumps the oplog to a text file
Correct answer: Creates a binary export of a MongoDB database or collection
mongodump creates a binary dump (BSON files) of a MongoDB database or collection, which can be restored using mongorestore.
Question 5: What authentication mechanism does MongoDB use by default for username/password authentication?
- MD5
- SHA-1
- SCRAM (Salted Challenge Response Authentication Mechanism) (Correct answer)
- Kerberos
Correct answer: SCRAM (Salted Challenge Response Authentication Mechanism)
SCRAM-SHA-1 and SCRAM-SHA-256 are MongoDB's default authentication mechanisms, providing secure password-based authentication without transmitting passwords.
Question 6: What is MongoDB's Encrypted Storage Engine used for?
- Encrypting network traffic between shards
- Encrypting data files at rest using AES-256 encryption (Correct answer)
- Encrypting field values within documents
- Encrypting backup files automatically
Correct answer: Encrypting data files at rest using AES-256 encryption
MongoDB Enterprise's encrypted storage engine encrypts all data files at rest using AES-256, protecting data if physical storage is compromised.
What is role-based access control (RBAC) in MongoDB?