[SERVER-16766] mongod fails to start with no error message with an incorrectly formatted auditFilter parameter Created: 07/Jan/15  Updated: 15/Sep/15  Resolved: 15/Sep/15

Status: Closed
Project: Core Server
Component/s: Security
Affects Version/s: 2.6.5
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Jay Runkel Assignee: Robert Guo (Inactive)
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File mongod.conf    
Sprint: Security 9 (09/18/15)
Participants:

 Description   

I have been helping a customer evaluate the auditing capabilities of MongoDB Enterprise. In their config file, they had an auditFilter parameter specified like:

auditFilter='{atype:{$in:["authCheck"]}, "param.command":{$in:["read"]}}'  

With this line in the config file, MongoDB fails to start and no error message is printed to the log file. Removing the outside '' as shown below resolves the problem, but mongod should print out an error message or something to the log file.

auditFilter={atype:{$in:["authCheck"]}, "param.command":{$in:["read"]}}

I have attached the complete mongod.conf file I used to recreate the problem.



 Comments   
Comment by Robert Guo (Inactive) [ 09/Sep/15 ]

I wasn't able to find an enterprise 2.6.5 so I used 2.6.11 from here: https://evergreen.mongodb.com/task/mongodb_mongo_v2.6_enterprise_ubuntu1404_64_compile_e748e49c88b0ea282770e3ddd46a7e3c3d96dd30_15_09_02_20_52_15

Running with the attached configuration file worked correctly for me. Please see the attached code, the first run is with the good version commented out and the second with the bad version commented out.

➜  bin  ./mongod -f mongod.conf
2015-09-09T11:39:26.087-0400 SEVERE: Failed global initialization: BadValue bad auditFilter:code FailedToParse: FailedToParse: Expecting '{': offset:0 of:'{atype:{$in:["authCheck"]}, "param.command":{$in:["read"]}}'
➜  bin  ./mongod -f mongod.conf
about to fork child process, waiting until server is ready for connections.
forked process: 4283
child process started successfully, parent exiting
➜  bin  ./mongo
MongoDB shell version: 2.6.12-pre-
connecting to: test
> db.test.insert({a:1})
WriteResult({ "nInserted" : 1 })

Generated at Thu Feb 08 03:42:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.