Docs Menu
Docs Home
/ /

Configurar el agente MongoDB para Kerberos

MongoDB Enterprise supports Kerberos. Kerberos is a network authentication protocol. The MongoDB Agent can authenticate to MongoDB instances that run Kerberos.

Kerberos tickets can authenticate users for a limited time. You must configure the Kerberos Key Distribution Center (KDC) to issue tickets that are valid for four hours or longer. The MongoDB Agent periodically renews the ticket. The KDC service provides session tickets and temporary session keys to users and hosts.

El Agente de MongoDB interactúa con las bases de datos de MongoDB en su implementación como lo haría un usuario de MongoDB. Por lo tanto, debe configurar su implementación de MongoDB y el Agente de MongoDB para que admitan la autenticación.

You can specify the deployment's authentication mechanisms when adding the deployment, or you can edit the settings for an existing deployment. At minimum, the deployment must enable the authentication mechanism you want the MongoDB Agent to use. The MongoDB Agent can use any supported authentication mechanism.

Para los fines de este tutorial, debes asegurarte de lo siguiente:

  • Su implementación admite la autenticación Kerberos y

  • El agente MongoDB utiliza la autenticación Kerberos.

Para saber cómo habilitar la autenticación Kerberos, consulte Habilitar la autenticación Kerberos para su proyecto de Ops Manager.

Se deben instalar dos archivos relacionados con Kerberos en cualquier host que ejecute Monitoring o Backup:

  • Cree o configure el archivo de configuración Kerberos5 krb.conf.

    Plataforma
    Ruta predeterminada
    notas

    Linux

    /etc/krb5.conf

    Windows

    %WINDIR%\krb5.ini

    Esta es la ruta predeterminada para las implementaciones de Kerberos que no se basan en Active Directory. Consulte la documentación de su implementación de Kerberos para su versión de Windows para saber dónde se almacena el archivo de configuración de Kerberos.

  • En sistemas Linux: asegúrese de que el binario kinit esté ubicado /usr/bin/kinit en. kinit obtiene o renueva un ticket de concesión de tickets Kerberos, que autentica al Agente mediante Kerberos.

1

An UPN is formatted in two parts so the service can be uniquely identified across the Kerberos realm:

Componente
Descripción

Service name

El nombre de un servicio que un host proporciona al ámbito Kerberos, como pop o ftp.

Kerberos realm

A set of managed hosts and services that share the same Kerberos database.

By Kerberos naming convention, the <KERBEROS_REALM> must be in all UPPERCASE.

Ejemplo

In a Kerberos realm set as EXAMPLE.COM, the MongoDB Agent would set its UPN to: mongodb-agent@EXAMPLE.COM

2

Generate a keytab file (*.keytab) for the MongoDB Agent UPN and copy it to the host that runs the MongoDB Agent. Ensure that the operating system user that runs the MongoDB Agent is the same operating system user that owns the keytab file.

Cuando se activa la automatización, Ops Manager administra la autenticación del agente MongoDB.

Para configurar Kerberos para la autenticación del agente MongoDB, consulte Habilitar la autenticación Kerberos para su proyecto de Ops Manager.

After creating the Kerberos UPN for the MongoDB Agent, create a MongoDB user on your deployment that corresponds to the MongoDB Agent's UPN and grant it privileges.

El lugar donde crea el usuario MongoDB depende de si utiliza o no la autorización LDAP.

Si utiliza la autorización LDAP en su implementación de MongoDB, debe crear un usuario y un grupo LDAP para el agente de MongoDB en el servidor LDAP. Después de crear el usuario y el grupo LDAP, asigne el grupo LDAP a un rol de MongoDB en la admin base de datos de su implementación.

Advertencia

Al usar la autorización LDAP, no cree ningún usuario de MongoDB en la $external base de datos. MongoDB 3.4 y versiones posteriores no se inician si existe un usuario de MongoDB en la $external base de datos y la autorización LDAP está habilitada.

Para el usuario de MongoDB que representa al Agente de MongoDB:

  1. Create a new LDAP user on your LDAP server named with the MongoDB Agent's UPN.

  2. Cree un grupo LDAP cuyo nombre coincida con el rol del agente MongoDB.

  3. Cree el rol del agente MongoDB en su base de datos admin con los permisos adecuados.

    Nota

    Cuando se activa la automatización, esta crea automáticamente un rol para el usuario del agente MongoDB para la autenticación LDAP.

  4. Asignar el usuario LDAP al grupo LDAP.

Tip

Para aprender a:
Ver

Crear un usuario LDAP

Documentación para su implementación LDAP.

Crear un grupo LDAP

Documentación para su implementación LDAP.

Asignar los roles apropiados para el Agente MongoDB

Asignar un grupo LDAP y un rol de MongoDB

Sección Roles LDAP de la página de autorización LDAP en el manual de MongoDB.

Configurar la autorización LDAP sin la automatización de Ops Manager

Página autorizacion LDAP en el manual de MongoDB.

If you are not using LDAP authorization, you must add the MongoDB Agent's UPN as a user in $external database in your MongoDB deployment. Without LDAP authorization, MongoDB uses the $external database to authenticate a user against Kerberos.

Nota

Para descubrir los roles apropiados para el MongoDB Agent, accede a: Required Access for MongoDB Agent.

mongoshDesde, emita los siguientes comandos para crear el usuario MongoDB:

db.getSiblingDB("$external").createUser(
{
user : "<Kerberos Principal>",
roles : [
{ role : "clusterAdmin", db : "admin" },
{ role : "readWriteAnyDatabase", db : "admin" },
{ role : "userAdminAnyDatabase", db : "admin" },
{ role : "dbAdminAnyDatabase", db : "admin" },
{ role : "backup", db : "admin" },
{ role : "restore", db : "admin" }
]
}
)

Volver

LDAP

En esta página