Para agentes de IA: um índice de documentação está disponível em https://www.mongodb.com/pt-br/docs/llms.txt — as versões de markdown de todas as páginas estão disponíveis anexando .md a qualquer caminho de URL.
Menu Docs

Configurar Autenticação LDAP de Vários Clusters

O MongoDB Enterprise oferece suporte a:

  • Proxy de solicitações de autenticação para um serviço LDAP (Lightweight Directory Access Protocol).

  • Vinculação simples e SASL a servidores LDAP. O MongoDB Enterprise pode vincular a um servidor LDAP via saslauthd ou por meio das bibliotecas do sistema operacional.

Para saber mais, consulte as seções Autenticação deLDAP LDAP na documentação do MongoDB Server .

Você pode usar o Operador Kubernetes para configurar o LDAP para autenticar seus aplicativos clientes que se conectam aos sistemas MongoDB de vários clusters Kubernetes. Este guia descreve como configurar a autenticação LDAP de aplicativos cliente para suas implantações do MongoDB de clusters multikubernetes.

  • To configure LDAP in CustomResourceDefinitions, use the parameters under the spec.security.authentication.ldap and other security LDAP settings specific to the MongoDB Agent, from the Kubernetes Operator MongoDB resource specification. The procedures in this section describe the required settings and provide examples of LDAP configuration.

  • To improve security, consider deploying a TLS-encrypted multi-cluster. Encryption with TLS is optional. By default, LDAP traffic is sent as plain text. This means that username and password are exposed to network threats. Many modern directory services, such as Microsoft Active Directory, require encrypted connections. Consider using LDAP over TLS to encrypt authentication requests in your Kubernetes Operator MongoDB deployments.

Antes de proteger seu sistema MongoDB de cluster multi-Kubernetes usando criptografia TLS , conclua as seguintes tarefas:

1

Atualize seu recurso personalizado do MongoDBMultiCluster com as configurações de segurança da especificação de recursos do MongoDBMultiCluster do Kubernetes Operator.

Para habilitar o LDAP em seu sistema, defina as seguintes configurações em seu objeto Kubernetes:

Chave
Tipo e necessidade
Descrição
Exemplo

booleano,
obrigatório

Configure para true para habilitar a autenticação LDAP.

true

string,
necessário

Especifique o nome diferenciado LDAP ao qual o MongoDB se liga ao conectar ao servidor LDAP.

cn=admin,dc=example,dc=org

string,
necessário

Especifique o nome do segredo que contém a senha do LDAP Bind Distinguished Name com a qual o MongoDB se liga ao conectar a um servidor LDAP.

<secret-name>

string,
opcional

Adicione o nome do ConfigMap que armazena a CA personalizada que você usou para assinar os certificados TLS da sua implantação.

<configmap-name>

string,
opcional

Adicione o nome do campo que armazena o CA que valida o certificado TLS do servidor LDAP.

<configmap-key>

array de strings,
necessário

Specify the list of hostname:port combinations of one or more LDAP servers. Para cada servidor, use uma linha separada.

<example.com:636>

string,
opcional

Configure para tls para utilizar LDAPS (LDAP sobre TLS). Deixe em branco se o servidor LDAP não aceitar TLS. Você deve habilitar o TLS ao implantar o recurso de reconhecimento de data center para usar essa configuração.

tls

string,
necessário

Specify the mapping that maps the username provided to mongod or mongos for authentication to an LDAP Distinguished Name (DN).

Para saber mais, consulte security.ldap.userToDNMapping e modelos de queryLDAP na documentação do MongoDB Server .

<match: "(.+)",substitution: "uid={0},ou=groups,dc=example,dc=org">

string,
necessário

Configure para LDAP para habilitar a autenticação por LDAP.

LDAP

A configuração resultante pode ser semelhante ao exemplo a seguir:

security:
authentication:
enabled: true
# Enabled LDAP Authentication Mode
modes:
- "LDAP"
- "SCRAM"
# LDAP related configuration
ldap:
# Specify the hostname:port combination of one or
# more LDAP servers
servers:
- "ldap1.example.com:636"
- "ldap2.example.com:636"
# Set to "tls" to use LDAP over TLS. Leave blank if
# the LDAP server doesn't accept TLS. You must enable TLS when
# you deploy the multi-cluster resource to use this setting.
transportSecurity: "tls"
# If TLS is enabled, add a reference to a ConfigMap that
# contains a CA certificate that validates the LDAP server's
# TLS certificate.
caConfigMapRef:
name: "<configmap-name>"
key: "<configmap-entry-key>"
# Specify the LDAP Distinguished Name to which
# MongoDB binds when connecting to the LDAP server
bindQueryUser: "cn=admin,dc=example,dc=org"
# Specify the password with which MongoDB binds
# when connecting to an LDAP server. This is a
# reference to a Secret Kubernetes Object containing
# one "password" key.
bindQueryPasswordSecretRef:
name: "<secret-name>"

Para obter uma lista completa das configurações LDAP, consulte as configurações de segurança na especificação de recursos do MongoDBMultiCluster do Kubernetes Operator. Consulte também a configuração spec.security.authentication.agents.automationUserName para o MongoDB Agent em seu sistema do Kubernetes Operator habilitado para LDAP.

2
  1. Para clusters de membros, execute os seguintes comandos para verificar se os MongoDB Pods estão no estado de execução:

    kubectl get pods \
    --context=$MDB_CLUSTER_1_FULL_NAME \
    --namespace mongodb
    kubectl get pods \
    --context=$MDB_CLUSTER_2_FULL_NAME \
    --namespace mongodb
    kubectl get pods \
    --context=$MDB_CLUSTER_3_FULL_NAME \
    --namespace mongodb
  2. No cluster do operador, execute o seguinte comando para verificar se o recurso MongoDBMultiCluster está no estado de execução:

    kubectl --context=$MDB_CENTRAL_CLUSTER_FULL_NAME \
    --namespace mongodb \
    get mdbmc multi-replica-set -o yaml -w