Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12543

Audit options allowed in legacy config file format

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Security
    • Labels:
    • Fully Compatible

      using the old conf file format:

      dbpath=data/db
      auth=true
      auditDestination=file
      auditFormat=JSON
      auditPath=data/db/auditLog.json
      auditFilter={ atype: "authenticate", "param.db": "test" }
      

      I get the following error because of the auditFilter

      ~/mongodb-build/mongo(master) $ ./mongod -f audit.conf
      Error parsing YAML config file: yaml-cpp: error at line 6, column 20: illegal map value
      try './mongod --help' for more information
      

      Same error with

      dbpath=data/db
      auth=true
      auditDestination=file
      auditFormat=JSON
      auditPath=data/db/auditLog.json
      auditFilter="{ 'atype': 'authenticate', 'param.db': 'test' }"
      

      and

      dbpath=data/db
      auditDestination=file
      auditFormat=JSON
      auditPath=data/db/auditLog.json
      auditFilter='{ atype: { $in: [ "createCollection", "dropCollection" ] } }'
      

      Also, using the commandline option, single quoting the filter works:

      ./mongod --dbpath data/db --auditDestination file --auditFilter '{ atype: { $in: [ "createCollection", "dropCollection" ] } }' --auditFormat JSON --auditPath data/db/auditLog.json
      
      

      But double quoting the filter tries to substitute for $in and throws an error:

      ./mongod --dbpath data/db --auditDestination file --auditFilter "{ atype: { $in: [ 'createCollection', 'dropCollection' ] } }" --auditFormat JSON --auditPath data/db/auditLog.json
      2014-01-29T21:16:43.424-0500 SEVERE: Failed global initialization: BadValue bad auditFilter:code FailedToParse: FailedToParse: First character in field must be [A-Za-z$_]: offset:11 of:{ atype: { : [ 'createCollection', 'dropCollection' ] } }
      

            Assignee:
            backlog-server-platform DO NOT USE - Backlog - Platform Team
            Reporter:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: