Docs Menu
Docs Home
/
MongoDB Ops Manager
/ /

Enable LDAP Authentication for your Ops Manager Project

On this page

  • Considerations
  • Procedure

Note

Starting with MongoDB 8.0, LDAP authentication and authorization is deprecated. The feature is available and will continue to operate without changes throughout the lifetime of MongoDB 8. LDAP will be removed in a future major release.

For details, see LDAP Deprecation.

Ops Manager enables you to configure the Authentication Mechanisms that all clients, including the Ops Manager Agents, use to connect to your MongoDB deployments. You can enable multiple authentication mechanisms for each of your projects, but you must choose only one mechanism for the Agents.

MongoDB Enterprise supports proxying authentication requests to a Lightweight Directory Access Protocol (LDAP) service.

LDAP is only available on MongoDB Enterprise builds. If you have existing deployments running on a MongoDB Community build, you must upgrade them to MongoDB Enterprise before you can enable LDAP for your Ops Manager project.

MongoDB Enterprise supports simple and SASL binding to Lightweight Directory Access Protocol (LDAP) servers via saslauthd and operating system libraries:

  • MongoDB Enterprise for Linux can bind to an LDAP server either via saslauthd or, starting in MongoDB 3.4, through the operating system libraries.

  • Starting in MongoDB version 3.4, MongoDB Enterprise for Windows can bind to an LDAP server through the operating system libraries.

The LDAP Proxy Authentication and LDAP Authorization sections in the MongoDB manual provide more information about LDAP and MongoDB. Setting up LDAP and SASL is beyond the scope of this document.

This procedure describes how to configure and enable LDAP authentication when using Automation. If Ops Manager doesn't manage Monitoring or Backup, you must manually configure them to use LDAP. To configure LDAP, see Configure MongoDB Agent for LDAP

Note

If you want to reset Authentication and TLS settings for your project, first unmanage any MongoDB deployments that Ops Manager manages in your project.

1
  1. If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.

  2. If it is not already displayed, select your desired project from the Projects menu in the navigation bar.

  3. If it is not already displayed, click Deployment in the sidebar.

  1. Click the Security tab.

  2. Click the Settings tab.

  3. Perform one of the following actions:

    • If this is your first time configuring TLS, authentication, or authorization settings for this project, click Get Started.

    • If you have already configured TLS authentication, or authorization settings for this project, click Edit.

2
Field
Action
MongoDB Deployment Transport Layer Security (TLS)
Toggle this slider to ON.
TLS CA File Path

The TLS Certificate Authority file is a .pem-format certificate file that contains the root certificate chain from the Certificate Authority. The MongoDB Agent uses this same Certificate Authority file to connect to every item in your deployment.

The encrypted private key for the .pem certificate file must be in PKCS #1 format. The MongoDB Agent doesn't support the PKCS #8 format.

Type the file path to the TLS Certificate Authority file on every host running a MongoDB process:

  • Type the file path on all Linux hosts in the first box.

  • Type the file path on all Windows hosts in the second box.

This enables the net.tls.CAFile setting for the MongoDB processes in the project.

Click Validate to test that each host in your deployment has a TLS Certificate Authority at the paths you specified.

Cluster TLS CA File Path

The .pem file that contains the root certificate chain from the Certificate Authority used to validate the certificate presented by a client establishing a connection. Specify the file name of the .pem file using relative or absolute paths. net.tls.clusterCAFile requires that net.tls.CAFile is set.

If you do not specify the net.tls.clusterCAFile, the cluster uses the .pem file specified in the net.tls.CAFile option.

net.tls.clusterCAFile lets you use separate Certificate Authorities to verify the client-to-server and server-to-client portions of the TLS handshake.

Client Certificate Mode

Select if client applications or MongoDB Agents must present a TLS certificate when connecting to a TLS-enabled MongoDB deployments. Each MongoDB deployment checks for certificates from these client hosts when they try to connect. If you choose to require the client TLS certificates, make sure they are valid.

Accepted values are:

Optional
Every client may present a valid TLS certificate when connecting to MongoDB deployments. MongoDB Agents might use TLS certificates if you don't set the mongod tlsMode to None.
Required
Every MongoDB deployment in this project starts with TLS-encrypted network connections. All Agents must use TLS to connect to any MongoDB deployment.

Warning

Recommend Using TLS (Transport Layer Security)/SSL (Secure Sockets Layer) with LDAP (Lightweight Directory Access Protocol)

By default, LDAP traffic is sent as plain text. This means that credentials (username and password) are exposed to basic network threats like sniffers and replay. Use LDAPS (LDAP over TLS/SSL) to encrypt authentication. Many modern directory services, such as Active Directory, require encrypted connections.

3
  1. In the MongoDB Agent Connections to Deployment section, select LDAP.

  2. Select the appropriate type of LDAP authentication.

    Important

    • If you are using LDAP authorization, you must select Native LDAP Authentication.

    • If you are not using LDAP authorization, you must add users to the $external database in your MongoDB deployment. For an example, see LDAP Authentication.

4

Important

Starting with MongoDB 3.4, you can authenticate users using LDAP, Kerberos, or X.509 certificates without requiring local user documents in the $external database as long as you enable LDAP authorization first. When such a user successfully authenticates, MongoDB performs a query against the LDAP server to retrieve all groups which that LDAP user possesses and transforms those groups into their equivalent MongoDB roles.

MongoDB processes restart in a rolling fashion when you apply these changes.

Skip this step if you selected Saslauthd in the previous step.

If you selected Native LDAP Authentication, complete the following steps:

  1. Provide the following values:

    Setting
    Value
    Server URL
    Specify the hostname:port combination of one or more LDAP servers.
    Transport Security
    Select TLS to encrypt your LDAP queries. If you do not need to encrypt the LDAP queries, select None.
    Timeout (ms)
    Specify how long an authentication request should wait before timing out.
    Bind Method

    Select either SASL or Simple.

    IMPORTANT: If you choose the Simple bind method, select TLS from the Transport Security because the Simple bind method passes the password in plain text.

    SASL Mechanisms
    Specify which SASL authentication service MongoDB uses with the LDAP server.
    Query User (LDAP Bind DN)
    Specify the LDAP Distinguished Name to which MongoDB binds when connecting to the LDAP server.
    Query Password (LDAP Bind DN)
    Specify the password with which MongoDB binds when connecting to an LDAP server.
    LDAP User Cache Invalidation Interval (s)
    Specify how long MongoDB waits to flush the LDAP user cache. Defaults to 30 seconds.
    User to Distinguished Name Mapping
    Specify an array of JSON documents that provide the ordered transformation(s) MongoDB performs on the authenticated MongoDB usernames. MongoDB then matches the transformed username against the LDAP DNs.
    Validate LDAP Server Config

    Select ON to validate the LDAP server configuration or OFF to skip validation.

    If ON and the configuration is invalid, the MongoDB deployment will not start.

  2. In the LDAP Authorization section, enter values for the following fields:

    Setting
    Value
    LDAP Authorization
    Toggle to ON to enable LDAP authorization.
    Authorization Query Template
    Specify a template for an LDAP query URL to retrieve a list of LDAP groups for an LDAP user.
    User to Distinguished Name Mapping
    Specify an array of JSON documents that provide the ordered transformation(s) MongoDB performs on the authenticated MongoDB usernames. MongoDB then matches the transformed username against the LDAP DNs.
5

Note

Remember

Ops Manager limits Agents to using one mechanism per deployment.

  1. Select the LDAP option from the Agent Auth Mechanism section.

  2. Provide credentials for the MongoDB Agent:

    Setting
    Value
    MongoDB Agent Username
    Enter the LDAP username.
    MongoDB Agent Password
    Enter the password for Agent's LDAP Username.
    MongoDB Agent LDAP Group DN
    If you enabled LDAP Authorization, enter the DN of the group of which the MongoDB Agent user is a member.
6
7
8

Otherwise, click Cancel and you can make additional changes.

9

After enabling LDAP Authorization, you need to create custom MongoDB roles for each LDAP Group you specified for LDAP Authorization.

Back

Use Username/Password Authentication