Docs Menu
Docs Home
/
엔터프라이즈 Kubernetes 운영자
/ /

LDAP를 사용한 보안 클라이언트 인증

MongoDB Enterprise 는 다음을 지원합니다.

  • 인증 요청을 LDAP(Lightweight Directory Access Protocol) 서비스로 프록시합니다.

  • LDAP 서버에 대한 단순 및 SASL 바인딩. MongoDB Enterprise는 saslauthd 또는 운영 체제 라이브러리를 통해 LDAP 서버에 바인딩할 수 있습니다.

자세한 내용은 MongoDB Server 설명서의 LDAP 프록시 인증LDAP 권한 부여 섹션을 참조하세요.

Kubernetes Operator를 사용하여 다중 Kubernetes 클러스터 MongoDB deployment에 연결하는 클라이언트 애플리케이션을 인증하도록 LDAP 구성할 수있습니다. 이 가이드 클라이언트 애플리케이션에서 다중 Kubernetes 클러스터 MongoDB 배포로 LDAP 인증 구성하는 방법을 설명합니다.

TLS 암호화를 사용하여 다중 Kubernetes 클러스터 MongoDB 배포를 보호하기 전에 다음 작업을 완료하세요.

1

Kubernetes 연산자MongoDBMultiCluster 리소스 사양 의 보안 설정으로 MongoDBMultiCluster 사용자 지정 리소스를 업데이트합니다 .

배포에서 LDAP 를 활성화하려면 Kubernetes 객체에서 다음 설정을 구성합니다.

유형 및 필요성
설명
예시
boolean,
required

LDAP 인증을 사용하려면 true 로 설정합니다.

true

string,
required

LDAP 서버에 연결할 때 MongoDB가 바인딩할 LDAP 고유 이름을 지정합니다.

cn=admin,dc=example,dc=org

string,
required

LDAP 서버 에 연결할 때 MongoDB 바인딩하는 LDAP 바인딩 고유 이름의 비밀번호가 포함된 시크릿 의 이름을 지정합니다.

<secret-name>

string,
optional

배포서버의 TLS인증서에 서명하는 데 사용한 사용자 지정 CA를 저장하는 ConfigMap 의 이름을 추가합니다.

<configmap-name>

string,
optional

LDAP 서버의 TLS 인증서의 유효성을 검사하는 CA 를 저장하는 필드 이름을 추가합니다.

<configmap-key>

array of strings,
required

하나 이상의 LDAP 서버의 hostname:port 조합 목록을 지정합니다. 각 서버에 대해 별도의 줄을 사용합니다.

<example.com:636>

string,
optional

LDAPS( TLS 를 통한 LDAP )를 사용하려면 tls 로 설정합니다. LDAP 서버가 TLS를 허용하지 않는 경우 비워 둡니다. 이 설정을 사용하려면 데이터베이스 리소스를 배포할 때 TLS를 사용하도록 설정해야 합니다.

tls

string,
required

인증을 위해 mongod 또는 mongos 에 제공된 사용자 이름을 LDAP DN(고유 이름)에 매핑하는 매핑을 지정합니다.

자세히 알아보려면 security.ldap.userToDNMapping 을 참조하세요. 및 LDAP 쿼리 템플릿 은 MongoDB Server 문서에서 확인할 수 있습니다.

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

string,
required

LDAP를 통해 인증을 사용하려면 LDAP 로 설정합니다.

LDAP

결과 구성은 다음 예시와 유사할 수 있습니다.

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>"

LDAP 설정의 전체 목록은 Kubernetes 연산자 MongoDBMultiCluster 리소스 사양 의 보안 설정을 참조하세요. LDAP 지원 Kubernetes 연산자 배포에서 MongoDB Agent 사용자에 대한 spec.security.authentication.agents.automationUserName 설정도 참조하세요.

2
  1. 멤버 cluster의 경우 다음 명령을 실행하여 MongoDB 파드가 실행 중 상태인지 확인합니다.

    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. 중앙 cluster에서 다음 명령을 실행하여 MongoDBMultiCluster 리소스가 실행 상태인지 확인합니다.

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

이 페이지의 내용