Why teams issue dynamic MongoDB users from OpenBao
Many applications and scheduled jobs still connect to MongoDB with one shared username and password stored in a configuration file or pipeline variable. When that credential is compromised, rotating it means coordinating every consumer at once, and the database logs show one identity for dozens of services. OpenBao's database secrets engine addresses both problems by creating a separate MongoDB user for each lease, with a time-to-live and a revocation path, so each consumer has its own identity and access can be removed without touching anything else. The MongoDB database plugin is not compiled into the core OpenBao binary. It is distributed separately in the openbao-plugins collection, so your team must download, register and pin it as a distinct artifact before a database/config entry for MongoDB can work. Confirm the current plugin packaging and registration steps in the openbao-plugins project before you plan the rollout.
Choose dynamic users when workloads can request credentials at startup or per job, the application can reconnect when a lease expires, and you want each service instance traceable in MongoDB's audit trail. Static roles fit better when an existing application account cannot be recreated and must be rotated on a schedule, which is covered on the static roles page. Use the database engine's dynamic roles for new services you control, and check whether your application driver handles credential renewal gracefully. Before committing, ask your MongoDB team which roles the generated users need, whether your deployment uses a replica set or sharded cluster, and how your audit requirements treat short-lived accounts. These answers determine the creation statements and the plugin version you pin.
How the MongoDB plugin fits between OpenBao and MongoDB
The flow starts when a client asks OpenBao's database secrets engine for a MongoDB credential. The engine calls the MongoDB plugin that was registered from openbao-plugins, and the plugin creates a user on the MongoDB deployment using a configured root or rotation account. Plugin artifacts come from a separate registry, so check that the registered version matches the one you pinned. When the lease expires, OpenBao asks the plugin to revoke that user.
Credential request, plugin call, MongoDB user creation and lease revocation.
Ways to get the plugin into your OpenBao servers
Pulling the plugin from an OCI registry and registering it through the plugin catalog ties the binary to a named artifact and version, which keeps installs repeatable across nodes. The artifact is fetched, its name, plugin type and checksum are registered, and the server loads the binary only when the registered values match. The sequence and field names depend on the openbao-plugins release you choose.
- Artifact reference: the tag or digest you pin, recorded in configuration management so every node pulls the same bytes.
- Registration entry: the plugin name, type, command and SHA-256 value the catalog checks before loading the plugin.
- Registry access: outbound network or mirror access from each node, plus credentials if the registry is private.
- Upgrade handling: a new artifact means a new digest and registration, tested in a staging cluster before nodes are updated one at a time.
Confirm the artifact format, the registration fields and the checksum behavior in the openbao-plugins documentation for your release line, and check core compatibility against the OpenBao releases page before you script the step.
A manually staged binary is copied onto each server and placed in the directory OpenBao reads plugins from, then registered with the same catalog step. This route gives you direct control over the file, but the team takes on the verification that a registry would otherwise handle. It suits small clusters and teams that already have a controlled artifact store for server binaries.
- Directory and ownership: place the file in the
plugin_directorypath with ownership and permissions limited to the OpenBao service account. - Hash recording: compute the SHA-256 value yourself, store it with the change record, and register that exact value on every node.
- Platform match: confirm the operating system, CPU architecture and build line match the OpenBao core version you run.
- Rollback copy: keep the previous binary beside the new one so a failed upgrade can be reversed without rebuilding the node.
Before you rely on this route, ask the openbao-plugins maintainers or your vendor contact how the plugin is built and signed, and confirm the file name, registration command and hash format for your release line.
For networks that cannot reach public registries, the plugin artifact is copied into an internal registry or file store that the OpenBao nodes can reach. The mirror becomes the source of truth, so the team must record where each artifact came from and how it was checked before it entered the network. Restarts and new nodes then depend only on internal services.
- Import process: a documented step that downloads the artifact outside the network, checks its checksum and signature where the project publishes them, and records the result.
- Internal endpoint: the registry or file location each node uses, with access limited to the OpenBao service identity.
- Independent startup: nodes load the plugin from the mirror without needing internet access at boot, which matters during incident recovery.
- Recurring ownership: someone must watch for new plugin releases and security fixes, then import them. This work repeats for every upgrade.
Ask your team to confirm which signatures and provenance records the openbao-plugins project publishes for your release line, and document the import steps as part of your change process before the first mirror sync.
Configuration options and when each one fits
This table compares the main configuration areas for the MongoDB plugin, from plugin registration and version pinning to connection strings, root credential handling, creation statements and TLS. Read each row for the situation where the option fits and what it changes once the plugin runs in your environment. Confirm exact parameter names and accepted values against the plugin documentation for the version you pin.
| Configuration area | When it fits | What it changes operationally |
|---|---|---|
| Plugin registration from an OCI artifact | Any deployment where the plugin binary must come from a controlled registry rather than the core OpenBao binary | Adds a separate artifact to track, mirror and approve, and the plugin must be registered before the database secrets engine can use it |
| Version pinning to a specific plugin release | Production clusters that need predictable behavior and a documented change record for each upgrade | Upgrades become deliberate changes that require testing against your MongoDB version, instead of following whatever the registry serves |
| Connection string with the root account | Single MongoDB deployment or replica set where one administrative account can create and revoke users | The root account becomes the most sensitive credential in the chain, so its scope, network path and rotation need an explicit owner |
| Root credential rotation | Teams that must not keep the initial administrative password after setup | Limits exposure of the bootstrap password, but requires confirming that the rotated credential is stored and recoverable by the operators who need it |
| Creation statements for dynamic users | Roles that need specific MongoDB roles or databases scoped per application or team | Defines what each generated user can do, so reviews of the statements are the main control on least privilege |
| Role lifetime and lease settings | Short-lived credentials for CI jobs or batch workloads, longer ones for stable services | Shorter leases raise renewal traffic and revocation activity, while longer leases widen the window a leaked credential stays valid |
| TLS for the MongoDB connection | Any connection that crosses a network segment you do not fully control, or that your assessors expect to be encrypted in transit | Requires certificates trusted by both OpenBao and MongoDB, and certificate expiry becomes an operational dependency to monitor |
| Static roles for existing accounts | Legacy applications that cannot accept dynamic users and need a rotated password instead | Shifts the work to rotation scheduling and to deciding who may read the current password |
How to install and register the MongoDB plugin
This sequence takes an OpenBao server from no MongoDB support to a working dynamic credential flow, with the plugin staged, its checksum pinned, the database engine mounted and one role tested through issuance and revocation. Each step ends with a check you can record for review. Confirm plugin-specific names, commands and privileges against the project documentation as you go.
Confirm OpenBao version compatibility
Record the OpenBao server version in production and staging, then check the MongoDB plugin's release notes or README for the OpenBao versions it supports. Core upgrades and plugin upgrades are separate changes in this model, so both versions belong in the same change record. The platform team owns this check. The step is complete when the team has a written version pair that the plugin documentation lists as supported. Confirm the exact support matrix with the plugin maintainers before continuing.
Stage the plugin artifact from openbao-plugins
Pull the MongoDB database plugin from the openbao-plugins project's OCI artifact, using the reference given in its documentation. Mirror the artifact into a registry you control so production hosts do not pull from public sources during deployment. Extract the binary on a staging host and run its version output to confirm it matches the release chosen in the previous step. The step is done when the extracted binary reports the expected version and the mirrored copy has the same digest as the source.
Compute and record the SHA256 checksum
On the staging host, compute the SHA256 checksum of the extracted plugin binary and store the value in your configuration management with the version and the OCI digest. Have a second person recompute the checksum from the mirrored copy without reusing the first result. Compare both values against any checksum the project publishes for that release. The step is complete when the computations match and the values sit in the change record, because the registration in the next step depends on this exact value.
Register the plugin with a pinned checksum
Copy the binary to the directory set by
plugin_directoryin the server configuration, owned by the OpenBao service account and writable only by that account. Register it in the plugin catalog as a database plugin with the pinned SHA256 value, using the register command from the plugin documentation. Use the exact plugin name the documentation gives, since the database mount refers to it. The step is done when the plugin catalog lists the MongoDB plugin with the pinned checksum and the expected version.Enable the database secrets engine
Mount the database secrets engine at a dedicated path, such as
database/or a path named for the MongoDB environment. Use a separate mount per MongoDB deployment when teams need separate roles or management accounts. If you isolate tenants with namespaces, enable the mount inside the tenant namespace. The step is complete when the engine appears in the list of enabled engines at the intended path, with no conflicting mount, and the MongoDB plugin is available to configure on it.Configure the MongoDB connection securely
Create a MongoDB user dedicated to OpenBao with only the privileges the plugin documentation lists for user management, and no application or administrator role. Write the connection configuration with TLS enabled and the hosts of your MongoDB deployment, then supply the management password. Rotate that password through OpenBao where the plugin supports root credential rotation, so only OpenBao holds the current value. Your network policy should limit direct logins with this account to OpenBao hosts. The step is complete when the configuration write succeeds and the plugin reports a working connection.
Create a dynamic MongoDB role
Create a dynamic role that maps to a MongoDB creation statement, and set default and maximum lease TTLs. Keep the statement to the narrowest database and roles the workload needs, and align the TTLs with the longest job or session that will use the credential. The statement syntax and any template variables come from the plugin documentation, so check them there. Read the role back and confirm the statement, database target and TTLs match the design. The step is complete when the role is readable and returns the intended statement.
Verify issuance and revocation
Request a credential from the role, then confirm the generated user can log in to MongoDB and holds only the privileges in the creation statement. Revoke the lease with the revoke command, then confirm the login now fails and the user no longer exists in MongoDB. Check that issuance and revocation appear in the audit log with the lease identifier. The step is done when both checks pass and the results are recorded, which gives the team that will run the plugin its baseline evidence.
How to upgrade the plugin without upgrading the core binary
The MongoDB plugin from openbao-plugins moves on its own release cadence, so it can change without a change to the OpenBao server. The cards below cover the sequence that keeps existing roles and leases working while the plugin is replaced, tested and, if needed, rolled back.
Track two release lines
The plugin and the OpenBao core binary each have their own versions and release notes, so a plugin release is not automatically matched to your running core version. Before any change, record the core version on every node and the plugin version currently registered. Read the plugin release notes for the core versions it was built and tested against. If the notes do not state a supported core range, ask the maintainers or your implementation partner to confirm it before you proceed.
OpenBao releasesTest the new version in staging
Deploy the candidate plugin to a staging cluster that runs the same core version and the same MongoDB major version as production. Register it under a separate plugin name so the production mount is untouched. Run a full cycle: create a dynamic role, issue credentials, connect with them, let a lease expire and revoke one manually. Compare the behavior with the current plugin before you accept the new build.
Re-register with the new checksum
OpenBao verifies a plugin binary against the SHA-256 checksum recorded at registration, so every new artifact needs a new registration with that checksum. Compute the checksum from the exact file you pulled, store it with the artifact in your registry, and register it through the plugin catalog. Confirm the plugin path and command match the existing mount before switching. A mismatched checksum should stop the change, not be overridden.
Confirm roles and leases continue
Existing dynamic roles hold their creation statements and leases already issued, so check that both still function after the switch. Issue a new credential with an existing role, confirm the MongoDB user is created with the expected roles, and check that a lease issued before the change can still be renewed or revoked. Record any role that fails so you can decide whether it needs its configuration updated.
Keep a rollback artifact
Keep the previous plugin binary, its checksum and its registration parameters in your artifact store until the new version has run in production for an agreed period. Rolling back means re-registering the old checksum and restarting the affected mount, so rehearse it in staging. Note that plugin versions that change database statements can affect users created during the test window, so review those users during rollback.
Questions teams ask before installing the MongoDB plugin
What drives the cost of installing the MongoDB plugin?
The main cost drivers are the number of plugins and OpenBao clusters in scope, the number of MongoDB deployments that need dynamic users, and the MongoDB topology each one runs on. A single replica set with one OpenBao cluster is a much smaller piece of work than several sharded clusters across separate networks. Network paths and TLS requirements between OpenBao and MongoDB add design and testing time, and the depth of testing you require (negative tests, failover, upgrade rehearsal) adds more. Ask for a quote that lists each deployment, the topology, the network zones crossed and the test cases, since those items determine the price. Costs for installation are largely one-time, while your ongoing cost is the operation of the plugin across upgrades.
How long does it take to install the MongoDB plugin?
Duration depends on the same inputs as cost: how many MongoDB deployments and OpenBao clusters are involved, how many environments must be built and tested in sequence, and how quickly change windows and access can be scheduled. Teams with a working OpenBao cluster and a test MongoDB deployment usually move faster than teams that must first build either one. Ask for a timeline in the written scope that separates discovery, a non-production install, testing, and the production change window, so you can see which steps depend on your approvals.
What do we need to provide for the MongoDB plugin work?
Plan to provide administrative access to the MongoDB deployments that will issue users, including an account that can create and manage roles and users for the plugin. You also need OpenBao operators who can approve registration of the plugin, change the mount configuration and review the results, plus access to the hosts or registries from which the plugin binary will be downloaded. Change windows are needed for production, and a named owner for each MongoDB deployment should be available during testing. Confirm these access paths before the work starts, because delays in access are a common cause of schedule slips.
Can our internal team install the MongoDB plugin without outside help?
Yes, a team that already runs OpenBao and MongoDB can install the plugin, because the work is configuration, registration and testing rather than new product code. The harder parts are the ones teams underestimate: designing least-privilege database roles, handling TLS and network paths, testing failover and lease cleanup, and writing an upgrade procedure for a plugin that lives outside the core binary. Ask yourself whether your team has time to test those paths in a non-production environment and keep the procedure current. A fixed-scope engagement can cover the parts you do not want to build from scratch, while your team keeps ownership of the running system.
What does a fixed-scope DeployOpen engagement cover for this plugin?
DeployOpen plans, implements and documents the work inside your infrastructure, such as cloud accounts, data centers or air-gapped networks. A fixed-scope engagement agrees in writing the deployments in scope, the plugin download and registration method, the version pinning and upgrade handling, the role and credential design, the test cases and the deliverables, plus the timeline. Changes to that scope are handled through a written change to the agreement. Ongoing support, upgrades and continuous testing are available as separate retainers, so confirm whether they are included or quoted separately. DeployOpen does not publish a price list, and a quote follows from the written scope.
What goes wrong most often after the MongoDB plugin is installed?
The most common problems are an unpinned plugin that changes version during a routine OpenBao upgrade, a plugin binary that no longer matches the core binary after an upgrade, and database roles that grant more privileges than the application needs. Teams also find that dynamic users are not cleaned up because lease revocation was not tested against the real MongoDB topology. Confirm that your plan pins the plugin version, records the checksum or source of the binary, tests a rollback, and includes a check that expired leases remove MongoDB users. These checks are part of the scope you should ask for.
Does DeployOpen certify that the MongoDB setup meets compliance requirements?
No. DeployOpen prepares systems, controls and evidence for compliance assessments, including documented configuration, access settings, and test results for dynamic MongoDB credentials. Independent auditors and certification bodies issue any audit report, attestation or certification. Ask your assessor early which evidence they expect for database credentials, such as role definitions, audit logs and lease records, so the work produces that evidence in the right form.
Limits to confirm in your environment
The MongoDB plugin depends on several version and topology facts that the OpenBao core documentation does not settle. Confirm each one against the openbao-plugins documentation and your own MongoDB estate before you commit to dynamic users, because a mismatch is easier to find in a test cluster than after credentials are issued in production.
Plugin and OpenBao line compatibility
Confirm which openbao-plugins release matches the OpenBao minor line you run, including the line you plan to move to next. The plugin ships separately from the core binary, so a core upgrade does not guarantee the plugin still loads or behaves the same way. Record the exact plugin version in your change records and test it against the OpenBao version in your staging environment before production.
OpenBao auth methodsMongoDB version support
Ask the plugin documentation which MongoDB server versions it is tested against and which driver behavior it depends on. Your MongoDB servers may run versions that the plugin does not list, or versions that your own application drivers do not yet support. Check both the database side and the client side before you set a dynamic user lifetime.
Replica set and sharded topology
Confirm how the plugin connects to a replica set, including the connection string options it accepts, how it handles primary elections, and whether it targets a specific member. For sharded clusters, confirm whether user creation runs through the mongos routers and how that interacts with your access control model. Test a failover while credentials are being issued to see whether leases still succeed.
Password policy fit
Compare the password characteristics the plugin generates with your organization's password policy and with any authentication settings your MongoDB deployment enforces. Confirm whether the generated passwords can be shaped through OpenBao password policies, and whether that shaping is supported for this plugin. Do not assume a policy option exists until the plugin documentation names it.
Audit statement coverage
List the exact user creation, role grant and revocation actions your auditors expect to see recorded, then check whether the plugin issues those statements in a form your MongoDB audit log can capture. Confirm how the plugin names created users, since the username format affects tracing a request back to a single workload. Ask for sample statements from the plugin and review them with your compliance team.
Root credential rotation
Confirm whether the plugin can rotate the root account it uses to manage users, how that rotation is triggered, and what happens to in-flight leases during the change. Decide who holds the rotated root credential afterward and where it is stored. Test a rotation in a non-production cluster before you rely on it for a production estate.
Operating dynamic MongoDB credentials after go-live
Once dynamic MongoDB users are issued, the operating question becomes how long each lease lasts and who renews it. Set the lease TTL per consumer rather than once for the whole mount: short TTLs suit web services that reauthenticate often, while batch jobs and reporting tools need a deliberate renewal pattern. For a job that runs longer than its TTL, have the job renew its own lease through the lease renewal API at intervals well inside the TTL, and make the job fail loudly if renewal is refused. Do not raise the maximum TTL to cover a job that never finishes, because a stalled job then holds a live MongoDB user for the whole period. Confirm the default and maximum TTL values in your own role configuration, since this page does not fix them.
Watch three signals continuously: plugin errors in the OpenBao server logs, failed revocations of expired leases, and the count of active leases per role. A revocation that fails leaves a MongoDB user behind, so alert on it and on any role whose lease count climbs without a matching rise in workload. Use the OpenBao telemetry and audit outputs to route these events to your monitoring system, and test the alert by revoking a lease while the MongoDB management connection is blocked. Because MongoDB user names come from the role template, include the role and service name in the generated user name so that a MongoDB audit or profiler entry can be traced back to one consumer and one OpenBao lease ID recorded in the audit log.
Rotate the management account that the plugin uses to create and drop users on a planned schedule and after any staff change. Create the new account in MongoDB with only the user administration roles the plugin needs, update the connection configuration in OpenBao to use the new credentials with root rotation so OpenBao alone knows the new password, and then confirm that a fresh dynamic credential can be issued and revoked. Retire the old account only after that test passes, and record the change in your runbook with the date and the operator. Confirm the exact root rotation steps and required MongoDB privileges against the plugin documentation for your OpenBao version before you schedule the first rotation.
How DeployOpen works on this
DeployOpen plans, installs and operates the MongoDB database plugin for OpenBao inside your own infrastructure, so the plugin version, its registration and its upgrade path are agreed and documented before any dynamic MongoDB user is issued. The work follows a written scope, with the plugin treated as a separately versioned component next to the OpenBao core binary.
How we scope
- The written scope names the MongoDB deployments, authentication setup and OpenBao mounts the plugin will serve.
- Scope records the OCI registry or artifact source, the pinned plugin version and who approves changes to it.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
How we build
- We download, verify and register the MongoDB plugin in a non-production OpenBao environment first.
- We test database connection, role creation, lease expiry and revocation against your MongoDB topology.
- We confirm the plugin loads after an OpenBao restart and records the same version in configuration.
How we hand over
- You receive the registration steps, version pin, upgrade runbook and rollback procedure in writing.
- Handover covers who can read the root connection settings and how that access is reviewed.
- Your team runs a documented test of issuing and revoking one dynamic MongoDB user before sign-off.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer.
- Plugin upgrades are tested against the OpenBao version you run before they reach production.
- We can review the plugin version after each OpenBao release and document any compatibility changes.

