MongoDB Questions and Answers – Auditing

«
»

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

1. The auditing facility can write audit events to the console, the _________ a JSON file, or a BSON file.
a) oplog
b) syslog
c) evallog
d) none of the mentioned
View Answer

Answer: b
Explanation: MongoDB provides an option to send output to the host’s syslog system.

advertisement

2. Point out the correct statement.
a) When a process writes to a resource, it takes an exclusive write lock to prevent other processes from writing to or reading from that resource
b) As clients insert new documents into the capped collection, the tailable cursor continues to retrieve documents
c) Write concern allows your application to detect insertion errors or unavailable mongod instances
d) All of the mentioned
View Answer

Answer: d
Explanation: MongoDB Enterprise includes an auditing capability for mongod and mongos instances.

3. _________ contains the local ip address and the port number of the running instance.
a) ts
b) local
c) remote
d) users
View Answer

Answer: b
Explanation: Remote document contains the remote ip address and the port number of the incoming connection associated with the event.

advertisement
advertisement

4. Enabling _____________ degrades performance more than logging only the authorization failures.
a) auditAuthorizationFailure
b) auditAuthorizationSuccess
c) auditAuthorizationlog
d) none of the mentioned
View Answer

Answer: b
Explanation: System Event Audit Message is available only in MongoDB Enterprise.

5. Use the ____________ option to enable auditing and specify where to output the audit events.
a) –auditLocation
b) –auditOutput
c) –auditDestination
d) None of the mentioned
View Answer

Answer: c
Explanation: For sharded clusters, if you enable auditing on mongos instances, you must enable auditing on all mongod instances in the cluster, i.e. shards and config servers.

advertisement

6. The audit file rotates at the same time as the ________ log file.
a) Client
b) Server
c) Application
d) All of the mentioned
View Answer

Answer: b
Explanation: Printing audit events to a file in JSON format degrades server performance more than printing to a file in BSON format.

7. To view the contents of the file, pass the file to the MongoDB utility ___________
a) bsonlog
b) bsonout
c) bsondump
d) SelectIndexes
View Answer

Answer: c
Explanation: The following converts the audit log into a human-readable form and output to the terminal: bsondump data/db/auditLog.bson .
advertisement

8. The _____________ option accepts either full path name or relative path name.
a) –auditPathLog
b) –logPath
c) –auditPath
d) None of the mentioned
View Answer

Answer: c
Explanation: To enable auditing and print audit events to a file in BSON binary format, specify file for the –auditDestination setting, BSON for the –auditFormat setting, and the output filename for the –auditPath.

9. The _________ message limit can result in the truncation of the audit messages.
a) oplog
b) syslog
c) evallog
d) none of the mentioned
View Answer

Answer: b
Explanation: The auditing system will neither detect the truncation nor error upon its occurrence.

advertisement

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