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

Audit log entry for insertMany only includes 1 document

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Gone away
    • Icon: Major - P3 Major - P3
    • None
    • 4.0.9
    • None
    • None
    • ALL
    • Hide

      mlaunch init --dir clusters/main --replicaset --nodes 1 --auditDestination file --auditFormat JSON --auditPath clusters/main/replset/rs1/audit.log --auth --setParameter auditAuthorizationSuccess=true

      Shell (after authenticating):

      MongoDB Enterprise replset:PRIMARY> use test
      MongoDB Enterprise replset:PRIMARY> db.test.insertMany([{a:1},{b:1},{c:1}])
      {
      	"acknowledged" : true,
      	"insertedIds" : [
      		ObjectId("5d002216c8ebbc12a504aa55"),
      		ObjectId("5d002216c8ebbc12a504aa56"),
      		ObjectId("5d002216c8ebbc12a504aa57")
      	]
      }
      

      Audit file:

      { "atype" : "authCheck", "ts" : { "$date" : "2019-06-11T14:50:14.698-0700" }, "local" : { "ip" : "127.0.0.1", "port" : 27017 }, "remote" : { "ip" : "127.0.0.1", "port" : 60741 }, "users" : [ { "user" : "user", "db" : "admin" } ], "roles" : [ { "role" : "clusterAdmin", "db" : "admin" }, { "role" : "userAdminAnyDatabase", "db" : "admin" }, { "role" : "readWriteAnyDatabase", "db" : "admin" }, { "role" : "dbAdminAnyDatabase", "db" : "admin" } ], "param" : { "command" : "insert", "ns" : "test.test", "args" : { "insert" : "test", "ordered" : true, "lsid" : { "id" : { "$binary" : "JOeKlQjLRK2vRQd7NJDGOQ==", "$type" : "04" } }, "$clusterTime" : { "clusterTime" : { "$timestamp" : { "t" : 1560289808, "i" : 1 } }, "signature" : { "hash" : { "$binary" : "4iDsdOVis5RHcK+h5LxWYNvwNyM=", "$type" : "00" }, "keyId" : { "$numberLong" : "6701392778519117825" } } }, "$db" : "test", "documents" : [ { "_id" : { "$oid" : "5d002216c8ebbc12a504aa55" }, "a" : 1 } ] } }, "result" : 0 }
      { "atype" : "authCheck", "ts" : { "$date" : "2019-06-11T14:50:14.708-0700" }, "local" : { "ip" : "127.0.0.1", "port" : 27017 }, "remote" : { "ip" : "127.0.0.1", "port" : 60741 }, "users" : [ { "user" : "user", "db" : "admin" } ], "roles" : [ { "role" : "clusterAdmin", "db" : "admin" }, { "role" : "userAdminAnyDatabase", "db" : "admin" }, { "role" : "readWriteAnyDatabase", "db" : "admin" }, { "role" : "dbAdminAnyDatabase", "db" : "admin" } ], "param" : { "command" : "replSetGetStatus", "ns" : "admin", "args" : { "replSetGetStatus" : 1, "forShell" : 1, "$clusterTime" : { "clusterTime" : { "$timestamp" : { "t" : 1560289814, "i" : 3 } }, "signature" : { "hash" : { "$binary" : "2+6hVAhdrssDlPVa7GI8o6rHub4=", "$type" : "00" }, "keyId" : { "$numberLong" : "6701392778519117825" } } }, "$db" : "admin" } }, "result" : 0 }
      

      Which only contains:

      "documents" : [ { "_id" : { "$oid" : "5d002216c8ebbc12a504aa55" }, "a" : 1 } ]
      

      Show
      mlaunch init --dir clusters/main --replicaset --nodes 1 --auditDestination file --auditFormat JSON --auditPath clusters/main/replset/rs1/audit.log --auth --setParameter auditAuthorizationSuccess=true Shell (after authenticating): MongoDB Enterprise replset:PRIMARY> use test MongoDB Enterprise replset:PRIMARY> db.test.insertMany([{a:1},{b:1},{c:1}]) { "acknowledged" : true, "insertedIds" : [ ObjectId("5d002216c8ebbc12a504aa55"), ObjectId("5d002216c8ebbc12a504aa56"), ObjectId("5d002216c8ebbc12a504aa57") ] } Audit file: { "atype" : "authCheck", "ts" : { "$date" : "2019-06-11T14:50:14.698-0700" }, "local" : { "ip" : "127.0.0.1", "port" : 27017 }, "remote" : { "ip" : "127.0.0.1", "port" : 60741 }, "users" : [ { "user" : "user", "db" : "admin" } ], "roles" : [ { "role" : "clusterAdmin", "db" : "admin" }, { "role" : "userAdminAnyDatabase", "db" : "admin" }, { "role" : "readWriteAnyDatabase", "db" : "admin" }, { "role" : "dbAdminAnyDatabase", "db" : "admin" } ], "param" : { "command" : "insert", "ns" : "test.test", "args" : { "insert" : "test", "ordered" : true, "lsid" : { "id" : { "$binary" : "JOeKlQjLRK2vRQd7NJDGOQ==", "$type" : "04" } }, "$clusterTime" : { "clusterTime" : { "$timestamp" : { "t" : 1560289808, "i" : 1 } }, "signature" : { "hash" : { "$binary" : "4iDsdOVis5RHcK+h5LxWYNvwNyM=", "$type" : "00" }, "keyId" : { "$numberLong" : "6701392778519117825" } } }, "$db" : "test", "documents" : [ { "_id" : { "$oid" : "5d002216c8ebbc12a504aa55" }, "a" : 1 } ] } }, "result" : 0 } { "atype" : "authCheck", "ts" : { "$date" : "2019-06-11T14:50:14.708-0700" }, "local" : { "ip" : "127.0.0.1", "port" : 27017 }, "remote" : { "ip" : "127.0.0.1", "port" : 60741 }, "users" : [ { "user" : "user", "db" : "admin" } ], "roles" : [ { "role" : "clusterAdmin", "db" : "admin" }, { "role" : "userAdminAnyDatabase", "db" : "admin" }, { "role" : "readWriteAnyDatabase", "db" : "admin" }, { "role" : "dbAdminAnyDatabase", "db" : "admin" } ], "param" : { "command" : "replSetGetStatus", "ns" : "admin", "args" : { "replSetGetStatus" : 1, "forShell" : 1, "$clusterTime" : { "clusterTime" : { "$timestamp" : { "t" : 1560289814, "i" : 3 } }, "signature" : { "hash" : { "$binary" : "2+6hVAhdrssDlPVa7GI8o6rHub4=", "$type" : "00" }, "keyId" : { "$numberLong" : "6701392778519117825" } } }, "$db" : "admin" } }, "result" : 0 } Which only contains: "documents" : [ { "_id" : { "$oid" : "5d002216c8ebbc12a504aa55" }, "a" : 1 } ]
    • Security 2019-07-01, Security 2019-07-15, Security 2019-07-29, Security 2019-08-12

    Description

      insertMany native audit doesn't provide the list of elements inserted

      the audit only shows the first element inserted in the list, it doesn't show the count of the elements in the list as well

       This occurs on MongoDB atlas and the On-prem as well.

      Attachments

        Activity

          People

            spencer.jackson@mongodb.com Spencer Jackson
            barak.gilboa@imperva.com barak gilboa
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: