문서 메뉴
문서 홈
/
MongoDB Enterprise Kubernetes 연산자
/ /

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

이 페이지의 내용

  • 고려 사항
  • 전제 조건
  • 다중 Kubernetes cluster 복제본 세트에 대한 LDAP 클라이언트 인증 구성
  • MongoDBMultiCluster 리소스를 업데이트하여 LDAP 인증을 사용하도록 설정합니다.
  • MongoDBMultiCluster 리소스가 실행 중인지 확인합니다.

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

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

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

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

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

  • CustomResourceDefinitions 에서 LDAP 를 구성하려면 아래의 매개변수 및 Kubernetes Operator MongoDBspec.security.authentication.ldap 리소스 사양의 MongoDB Agent와 관련된 기타 보안 LDAP 설정 을 사용합니다. 이 섹션의 절차에서는 필요한 설정을 설명하고 LDAP 구성의 예를 제공합니다.

  • 보안을 강화하려면 TLS로 암호화된 멀티 클러스터 배포를 고려하세요. TLS 를 사용한 암호화는 선택 사항입니다. 기본적으로 LDAP 트래픽은 일반 텍스트로 전송됩니다. 이는 사용자 이름과 비밀번호가 네트워크 위험에 노출되었음을 의미합니다. Microsoft Active Directory와 같은 많은 최신 디렉토리 서비스에는 암호화된 연결이 필요합니다. Kubernetes Operator MongoDB deployment에서 인증 요청을 암호화하려면 TLS/SSL 을 통한 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
ConfigMap 추가 배포의 TLS 인증서에 서명하는 데 사용한 사용자 지정 CA 를 저장하는 의 이름입니다.
<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