Documentation

Role-Based Access Control (RBAC)

Access Control

Manage MongoDB users, roles, and permissions. Create database users with different authentication methods, define custom roles with granular privileges, and monitor active sessions.

Note: Admin access to the admin database is required for full RBAC management. Without admin privileges, you'll have limited functionality.

RBAC Dashboard overview with statistics cards and recent activity
Video RBAC02 Getting Started with RBAC - Overview of dashboard, creating users, and assigning roles

Dashboard Overview

The Dashboard tab provides a high-level view of your MongoDB security configuration.

Statistics Cards

  • Total Users - Count of all database users
  • Active Users - Non-disabled user accounts
  • Total Roles - Built-in and custom roles combined
  • Custom Roles - User-defined custom roles
  • Total Databases - Databases in the deployment
  • Active Sessions - Currently active user connections

Quick Actions

  • Create User - Opens the create user form
  • Create Role - Opens the custom role creation form
  • View All Users - Navigate to Users tab
  • View Roles - Navigate to Roles tab
  • Refresh - Reload dashboard statistics

Users Tab

The Users tab provides comprehensive user management with filtering, search, and bulk operations.

Users tab with search, filters, and user list table

User List Features

  • Search - Search by username, principal, or auth database
  • Type Filter - Filter by SCRAM, X.509, or External auth
  • Role Filter - Filter users by assigned role
  • Database Filter - Filter by authentication database
  • Bulk Selection - Select multiple users for bulk operations

User Display Columns

ColumnDescription
PrincipalUsername@authDB for SCRAM, DN for X.509, or principal for External
TypeAuthentication type badge (SCRAM, X509, EXTERNAL)
RolesAssigned roles in role@database format
StatusActive or Disabled indicator
ActionsView, Enable/Disable, Delete buttons

Creating Users

Video RBAC04 Creating a New User - Step-by-step guide with role assignment
Create User modal showing authentication type selection and form fields

SCRAM Authentication (Default)

FieldDescriptionRequired
UsernameUnique username for database authenticationYes
PasswordUser password (masked with show/hide toggle)Yes
Auth DatabaseDatabase where credentials are stored (typically 'admin')Yes
RolesAssign roles with database scope (e.g., readWrite@mydb)At least one

X.509 Certificate Authentication

FieldDescriptionRequired
Distinguished NameFull X.509 certificate subject DNYes
RolesAssign roles with database scopeAt least one

External Authentication (LDAP, Kerberos, AWS IAM)

FieldDescriptionRequired
PrincipalExternal principal identifier (LDAP DN, Kerberos principal, AWS ARN)Yes
MechanismAuthentication mechanism (LDAP, GSSAPI, MONGODB-AWS)Yes
RolesAssign roles with database scopeAt least one

User Detail View

User Detail modal showing Overview, Roles, Effective Privileges, and Sessions tabs
  • Overview Tab - Principal, auth type, roles, status, timestamps
  • Roles Tab - Manage assigned roles (grant/revoke)
  • Effective Privileges Tab - Computed permissions from all roles
  • Sessions Tab - Active sessions with client IP and connection time

Roles Tab

Manage built-in MongoDB roles and create custom roles for specific security requirements.

Roles tab with search, scope filter, and role list table

Built-in Database Roles

RoleDescription
readRead-only access to all non-system collections
readWriteRead and write access to all non-system collections
dbAdminDatabase administration (create collections, indexes)
dbOwnerFull database admin (readWrite + dbAdmin + userAdmin)
userAdminCreate and manage users and roles

Built-in Cluster Roles

RoleDescription
clusterAdminFull cluster administration access
clusterMonitorRead-only monitoring access
backupBackup operations
restoreRestore from backups
rootSuperuser with all privileges

Creating Custom Roles

Video RBAC08 Creating a Custom Role - Defining privileges and inheritance
Create Role modal with name, database, privileges, and inherited roles

Role Configuration

FieldDescriptionRequired
Role NameUnique name for the custom roleYes
DatabaseDatabase where the role is definedYes
DescriptionHuman-readable description of the roleNo
PrivilegesSpecific actions on resourcesAt least one
Inherited RolesOther roles this role inherits fromNo

Privilege Resource Types

  • Cluster - Cluster-wide administrative actions
  • Database - Database-level operations (createCollection, dropDatabase)
  • Collection - Collection-level operations (find, insert, update, remove)
  • Any Resource - Grants privilege on all databases/collections

Common Collection Actions

ActionDescription
findQuery documents
insertInsert new documents
updateModify existing documents
removeDelete documents
createIndexCreate indexes
dropIndexRemove indexes

Effective Privileges

View the complete set of permissions a user or role has, including inherited privileges.

Effective Privileges panel with hierarchical resource tree
  • Privilege Aggregation - Computes all privileges from roles and inheritance
  • Resource Grouping - Organizes by resource type (cluster, database, collection)
  • Inheritance Chain - Shows which role granted each privilege

Session Monitoring

Monitor active user sessions to track database connections.

Sessions tab showing active connections with session details

Session Information

FieldDescription
Session IDUnique identifier for the connection
Client IPSource IP address
Connection TimeWhen the session started
Last ActiveTimestamp of last operation
Client AppDriver or application name

Tips

  • Least Privilege - Grant only minimum permissions needed for tasks
  • Use Built-in Roles First - Create custom roles only when needed
  • Role Composition - Build complex roles by inheriting from simpler ones
  • Regular Audits - Periodically review user accounts and role assignments
  • Disable vs Delete - Disable accounts temporarily instead of deleting

Ready to try VisuaLeaf?

Download and start managing your MongoDB databases with ease.

Download Free Trial