MongoDB MCQs – Security

11.) What is the purpose of the keyFile in MongoDB?

A) To encrypt data
B) To authenticate members of a replica set
C) To compress data
D) To back up data

Answer: Option B

Explanation: The keyFile is used to authenticate members of a replica set.

12.) Which of the following is true about MongoDB field-level encryption?

A) It encrypts specific fields in a document
B) It encrypts the entire database
C) It encrypts only the _id field
D) It is not supported in MongoDB

Answer: Option A

Explanation: Field-level encryption encrypts specific fields in a document.

13.) Which command is used to enable role-based access control (RBAC) in MongoDB?

A) mongod –role
B) mongod –enableRBAC
C) mongod –secure
D) mongod –auth

Answer: Option D

Explanation: The mongod –auth command enables role-based access control (RBAC) in MongoDB.

14.) What is the purpose of the db.revokeRolesFromUser() command?

A) To create a new user
B) To remove roles from an existing user
C) To encrypt data
D) To back up data

Answer: Option B

Explanation: The db.revokeRolesFromUser() command removes roles from an existing user.

15.) Which of the following is true about MongoDB network encryption?

A) It uses SSL/TLS to encrypt data in transit
B) It uses AES-256 to encrypt data at rest
C) It uses RSA to encrypt data
D) It does not support network encryption

Answer: Option A

Explanation: MongoDB uses SSL/TLS to encrypt data in transit.

16.) Which of the following is true about MongoDB encryption at rest?

A) It does not support encryption at rest
B) It uses RSA encryption
C) It uses SSL/TLS encryption
D) It uses AES-256 encryption

Answer: Option D

Explanation: MongoDB uses AES-256 encryption for data at rest.

17.) MongoDB uses AES-256 encryption for data at rest.

A) MongoDB supports only SCRAM-SHA-1
B) MongoDB supports multiple authentication mechanisms
C) MongoDB does not support authentication
D) MongoDB supports only LDAP

Answer: Option B

Explanation: MongoDB supports multiple authentication mechanisms, including SCRAM, LDAP, and Kerberos.

18.) What is the purpose of the db.changeUserPassword() command?

A) To change a user’s password
B) To create a new user
C) To encrypt data
D) To back up data

Answer: Option A

Explanation: The db.changeUserPassword() command changes a user’s password.

19.) Which of the following is true about MongoDB auditing?

A) It logs all read operations
B) It logs all write operations
C) It logs all administrative actions
D) It logs all queries

Answer: Option C

Explanation: MongoDB auditing logs all administrative actions for security and compliance purposes.

20.) What is the purpose of the db.dropUser() command?

A) To create a new user
B) To delete an existing user
C) To encrypt data
D) To back up data

Answer: Option B

Explanation: The db.dropUser() command deletes an existing user.

Leave a Reply

Your email address will not be published. Required fields are marked *