Challenge - 5 Problems
MongoDB Audit Logging Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
MongoDB Audit Log Enablement Command Output
You run the following command to enable audit logging in MongoDB:
db.adminCommand({ setParameter: 1, auditAuthorizationSuccess: true })
What is the expected output of this command?MongoDB
db.adminCommand({ setParameter: 1, auditAuthorizationSuccess: true })Attempts:
2 left
💡 Hint
The command returns a simple status object indicating success or failure.
✗ Incorrect
The setParameter admin command returns { "ok" : 1 } on success without echoing the parameter value.
🧠 Conceptual
intermediate1:00remaining
Purpose of MongoDB Audit Logging
What is the primary purpose of enabling audit logging in MongoDB?
Attempts:
2 left
💡 Hint
Think about why organizations track user actions and system events.
✗ Incorrect
Audit logging records who did what and when in the database, helping with security audits and compliance.
❓ Configuration
advanced2:00remaining
Correct Audit Log Configuration in mongod.conf
Which of the following is the correct snippet to enable audit logging in the mongod.conf file with JSON format and output to a file named audit.log?
Attempts:
2 left
💡 Hint
Check the exact keys and values required by MongoDB for auditLog configuration.
✗ Incorrect
The correct keys are destination, format, and path. The format must be JSON or BSON. The path key specifies the file location.
❓ Troubleshoot
advanced1:30remaining
Audit Log Not Created After Configuration
After configuring audit logging in mongod.conf and restarting MongoDB, no audit log file is created. Which is the most likely cause?
Attempts:
2 left
💡 Hint
Think about file system permissions and user rights.
✗ Incorrect
If MongoDB cannot write to the specified directory due to permissions, the audit log file won't be created.
✅ Best Practice
expert2:00remaining
Best Practice for Managing MongoDB Audit Logs in Production
Which of the following is the best practice for managing MongoDB audit logs in a production environment?
Attempts:
2 left
💡 Hint
Consider security and disk space management.
✗ Incorrect
Regular rotation prevents disk space issues and storing logs securely protects sensitive audit data.