MongoDB Enterprise 는 다음을 지원합니다.
인증 요청을 LDAP(Lightweight Directory Access Protocol) 서비스로 프록시합니다.
LDAP 서버에 대한 단순 및 SASL 바인딩. MongoDB Enterprise는
saslauthd또는 운영 체제 라이브러리를 통해 LDAP 서버에 바인딩할 수 있습니다.
To learn more, see the LDAP Proxy Authentication and LDAP Authorization sections in the MongoDB Server documentation.
Kubernetes Operator를 사용하여 다중 Kubernetes cluster MongoDB deployment에 연결하는 클라이언트 애플리케이션을 인증하도록 LDAP 를 구성할 수 있습니다. 이 가이드에서는 클라이언트 애플리케이션에서 다중 Kubernetes 클러스터 MongoDB 배포로 LDAP 인증을 구성하는 방법을 설명합니다.
고려 사항
To configure LDAP in CustomResourceDefinitions, use the parameters under the
spec.security.authentication.ldapand 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.보안을 강화하려면 TLS로 암호화된 멀티 클러스터 배포를 고려하세요. TLS를 사용한 암호화는 선택 사항입니다. 기본적으로 LDAP 트래픽은 평문으로 전송됩니다. 이는 사용자 이름과 비밀번호가 네트워크 위협에 노출되는 것을 의미합니다. Microsoft Active Directory와 같은 많은 현대 디렉토리 서비스에서는 암호화된 연결이 필요합니다. Kubernetes 연산자 MongoDB 배포서버에서 인증 요청을 암호화하기 위해 LDAP를 TLS를 통해 사용하는 것을 고려하십시오.
전제 조건
TLS 암호화 를 사용하여 멀티 Kubernetes 클러스터 MongoDB deployment 를 보호하기 전에 다음 작업을 완료하세요.
다중 Kubernetes cluster 복제본 세트에 대한 LDAP 클라이언트 인증 구성
MongoDBMultiCluster 리소스를 업데이트하여 LDAP 인증 활성화 하도록 설정합니다.
Kubernetes 연산자MongoDBMultiCluster 리소스 사양 의 보안 설정으로 MongoDBMultiCluster 사용자 지정 리소스를 업데이트합니다 .
배포에서 LDAP 를 활성화하려면 Kubernetes 객체에서 다음 설정을 구성합니다.
키 | 유형 및 필요성 | 설명 | 예시 |
|---|---|---|---|
| 불리언, | LDAP 인증을 사용하려면 |
|
| string, | LDAP 서버에 연결할 때 MongoDB가 바인딩할 LDAP 고유 이름을 지정합니다. |
|
| string, | LDAP 서버 에 연결할 때 MongoDB 바인딩하는 LDAP 바인딩 고유 이름의 비밀번호가 포함된 시크릿 의 이름을 지정합니다. |
|
| string, | ConfigMap 추가 배포의 TLS 인증서에 서명하는 데 사용한 사용자 지정 CA 를 저장하는 의 이름입니다. |
|
| string, | LDAP 서버의 TLS 인증서의 유효성을 검사하는 CA 를 저장하는 필드 이름을 추가합니다. |
|
| 문자열 배열, | 하나 이상의 LDAP 서버의 |
|
| string, | LDAPS( TLS 를 통한 LDAP )를 사용하려면 |
|
| string, | Specify the mapping that maps the username provided to To learn more, see |
|
| string, | 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 설정도 참조하세요.
MongoDBMultiCluster 리소스가 실행 중인지 확인합니다.
멤버 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 중앙 cluster에서 다음 명령을 실행하여
MongoDBMultiCluster리소스가 실행 상태인지 확인합니다.kubectl --context=$MDB_CENTRAL_CLUSTER_FULL_NAME \ --namespace mongodb \ get mdbmc multi-replica-set -o yaml -w