MongoDB Authentication
Security hardening for NMIS and OMK found the following findings
Single identity
A single identity (username and password) was used for MongoDB administration and operations for NMIS and all OMK products:
Username | Role | Used by | Password |
|---|---|---|---|
| the legacy pre-NMIS 9.7.0 shared identity, | NMIS and every other OMK product on the host | op42Flow42 |
This is no longer secure and the following solution was implemented.
Separated Identities
The solution is to implement the following policies:
least privilege principle
separate identities for each product
no shared secrets
From NMIS 9.7.0 and the the following identities are used:
Username | Role | Used by | Password |
|---|---|---|---|
|
| nothing at runtime; bootstrap and administration only | generated, stored in the handoff file |
|
| the NMIS application at runtime | generated, stored in |
|
| OMK bootstrap and administration only |
|
|
| the OMK applications at runtime | generated, stored in |
| the pre-NMIS 9.7.0 shared identity, | Not created on a fresh install, for an upgrade, left exactly as found; nothing removes it, you have to explicitly remove it. |
|
The legacy OMK account
The migration performed by the NMIS Installer is additive and nothing removes the old opUserRW shared account; it keeps its published password until someone runs admin/setup_mongodb.pl removelegacyuser=1. The removelegacyuser command declines with a reason until the host is ready to run the command, and the removelegacyuser command is not run automatically by anything.
The legacy OMK compatibility account
That account is created only on request, is scoped to the OMK databases, carries a published password and is restricted to local connections.
The MongoDB credential handoff file
The credential handoff file is named /usr/local/etc/firstwave/mongodb-admin-password, mode 0600 and root-owned, since that is how an operator with root access recovers administrative access.