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

collStats and dbStats should work for a user with the clusterMonitor role

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.5.4
    • Affects Version/s: None
    • Component/s: Security
    • Fully Compatible
    • ALL

      Expected: A user who has only the clusterMonitor role should be authorized to run the collStats and dbStats commands.

      Actual: access denied

      Here is the test output that detects this failure:

      ----
      collStats: expected authorization success but received {
      	"ok" : 0,
      	"errmsg" : "not authorized on roles_commands_1 to execute command { collStats: \"bar\", scale: 1.0 }",
      	"code" : 13
      } on db roles_commands_1 with role clusterMonitor
      ----
      
      ----
      collStats: expected authorization success but received {
      	"ok" : 0,
      	"errmsg" : "not authorized on roles_commands_2 to execute command { collStats: \"bar\", scale: 1.0 }",
      	"code" : 13
      } on db roles_commands_2 with role clusterMonitor
      ----
      
      ----
      dbStats: expected authorization success but received {
      	"ok" : 0,
      	"errmsg" : "not authorized on roles_commands_1 to execute command { dbStats: 1.0, scale: 1024.0 }",
      	"code" : 13
      } on db roles_commands_1 with role clusterMonitor
      ----
      
      ----
      dbStats: expected authorization success but received {
      	"ok" : 0,
      	"errmsg" : "not authorized on roles_commands_2 to execute command { dbStats: 1.0, scale: 1024.0 }",
      	"code" : 13
      } on db roles_commands_2 with role clusterMonitor
      ----
      

      The test jstests/auth/commands.js does not detect this failure because in these two tests the "clusterMonitor" role is misspelled as "monitor" (see here and here).

      This problem was created as part of the change that first split the clusterAdmin role into clusterManager, hostManager, and clusterMonitor (git revision 878f2da2f8e87dac0f6b34a97a393576e4d8ff99 and SERVER-9514).

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: