KeplerGrid guide

See who can access a MongoDB collection

Right-click a collection and choose Who has access? to review stored role grants for that namespace, including the inherited roles behind specific actions.

Open the collection grants

Connect to a self-managed MongoDB server with permission to view users across authentication databases and to inspect relevant users and role definitions. Keep the KeplerGrid connection Read only for this inspection.

  1. In the database browser, right-click the intended collection and select Who has access?.
  2. Confirm the connection and collection in the dialog. Under Collection grants, use Filter by user, action, role, or scope to narrow the list. Clear the filter to see the full returned list.
  3. Expand a user to see its Auth DB, matching resource scopes and actions. The authentication database identifies the account. The resource scope tells you where its grant applies.

Trace directly assigned and inherited roles

In the practice collection below, both readers can find documents in keplergrid_access_lab.orders. The direct reader receives order_reader itself. The inherited reader receives order_support, which includes the same order_reader grant.

Expand each reader and look under Read documents. KeplerGrid labels the granting role Assigned directly for direct_reader and Inherited · via order_support @ keplergrid_access_lab for inherited_reader. Open Role inheritance to see the chain on the inherited account.

Set up the example on a disposable server

On a disposable self-managed MongoDB server, sign in to mongosh with an existing administrator who can create users and roles in the two practice databases. Use fresh databases for this example. Each prompt asks for a new synthetic password. Stay connected as the administrator to inspect both readers.

const lab = db.getSiblingDB("keplergrid_access_lab");
const ids = db.getSiblingDB("keplergrid_access_ids");

lab.orders.insertOne({ _id: "ORD-1", status: "paid" });
lab.createRole({
  role: "order_reader",
  privileges: [{
    resource: { db: "keplergrid_access_lab", collection: "orders" },
    actions: ["find"]
  }],
  roles: []
});
lab.createRole({
  role: "order_support",
  privileges: [],
  roles: ["order_reader"]
});
ids.createUser({
  user: "direct_reader",
  pwd: passwordPrompt(),
  roles: [{ role: "order_reader", db: "keplergrid_access_lab" }]
});
ids.createUser({
  user: "inherited_reader",
  pwd: passwordPrompt(),
  roles: [{ role: "order_support", db: "keplergrid_access_lab" }]
});

Interpret incomplete account coverage

  • Incomplete account coverage means some accounts could not be fully checked or shown, or some grant scopes could not be matched. Treat the rows as partial evidence and resolve the reported coverage issue before drawing a conclusion.
  • Role sources are unavailable means MongoDB reported grants, but KeplerGrid could not verify which roles supplied them with the information available.
  • If the server denies the account list, use an account authorized to inspect it. Stored role grants describe MongoDB permissions. Sign-in restrictions and external identity providers can also affect who can connect.

Use Refresh after a role change. If the connection itself fails before you can inspect the collection, use the authentication troubleshooting guide.

To check a running connection, inspect MongoDB server health.

To give someone read access to a single database, set up a read-only MongoDB user.