자체 관리형 MongoDB 로 멤버십 인증에 X.509 인증서 사용
MongoDB supports X.509 certificate authentication for use with a secure TLS/SSL connection. Sharded cluster members and replica set members can use X.509 certificates to verify their membership to the cluster or the replica set instead of using keyfiles. The membership authentication is an internal process.
참고
MongoDB는 TLS 1.1 이상이 사용 가능한 시스템에서 TLS 1.0 암호화를 지원하지 않습니다.
내부 인증을 활성화하면 자체 관리 배포에서 역할 기반 접근 제어도 활성화됩니다. 클라이언트는 배포에 연결하고 작업을 수행하기 위해 사용자로 인증해야 합니다.
사용자를 배포에 추가하는 방법에 대한 지침은 자체 관리 배포에서 사용자 및 역할 관리 튜토리얼을 참조하세요.
See the X.509 인증서를 사용하여 자체 관리 배포서버에서 클라이언트 인증하기 tutorial for instructions on using X.509 certificates for user authentication.
중요
A full description of TLS/SSL, PKI (Public Key Infrastructure) certificates, in particular X.509 certificates, and Certificate Authority is beyond the scope of this document. This tutorial assumes prior knowledge of TLS/SSL as well as access to valid X.509 certificates.
Member X.509 Certificate
참고
You must have valid X.509 certificates.
--tlsAllowInvalidCertificates
또는 net.tls.allowInvalidCertificates: true
를 지정하는 경우 잘못된 인증서로 TLS 연결을 설정할 수는 있지만 인증에는 충분하지 않습니다.
인증서 요구 사항
멤버 인증서를 사용하여 샤딩된 클러스터 또는 복제본 세트에 대한 멤버 자격을 확인합니다. 회원 인증서 파일 경로는 net.tls.clusterFile
및 net.tls.certificateKeyFile
옵션으로 구성됩니다. 멤버에게는 다음과 같은 구성 요구 사항이 있습니다.
클러스터 멤버 구성은 인증에 사용되는 속성 중 하나 이상에 대해 비어 있지 않은 값을 지정해야 합니다. 기본적으로 MongoDB는 다음을 허용합니다.
조직 (
O
)조직 단위 (
OU
)도메인 구성 요소 (
DC
)
net.tls.clusterAuthX509.extensionValue
를 설정하여 인증에 사용할 대체 속성을 지정할 수 있습니다.
클러스터 멤버 구성에는 동일한
net.tls.clusterAuthX509.attributes
이 포함되어야 하며 일치하는 값을 사용해야 합니다. 속성 순서는 중요하지 않습니다. 다음 예에서는O
과OU
설정하지만DC
는 설정하지 않습니다.net: tls: clusterAuthX509: attributes: O=MongoDB, OU=MongoDB Server
인증서에는 다음과 같은 요구 사항이 있습니다.
단일 인증 기관(CA)은 샤딩된 클러스터 또는 복제본 세트 의 멤버에 대해 모든 X.509 인증서를 발급해야 합니다.
Subject Alternative Name (
SAN
) 항목 중 하나 이상은 다른 클러스터 멤버가 사용하는 서버 호스트 이름과 일치해야 합니다.SAN
을 비교할 때 MongoDB는 DNS 이름 또는 IP 주소 중 하나를 비교할 수 있습니다.subjectAltName
을(를) 지정하지 않으면 MongoDB는 대신 CN(일반 이름)을 비교합니다. 그러나 이러한 CN 사용은 RFC 2818에 따라 더 이상 사용되지 않습니다.certificateKeyFile
로 사용되는 인증서에extendedKeyUsage
이 포함되어 있는 경우clientAuth
("TLS 웹 클라이언트 인증")와serverAuth
("TLS 웹 서버 인증")을 모두 포함해야 합니다.extendedKeyUsage = clientAuth, serverAuth clusterFile
로 사용된 인증서에extendedKeyUsage
가 포함되어 있다면, 그 값은 반드시clientAuth
를 포함해야 합니다.extendedKeyUsage = clientAuth
복제본 세트/샤딩된 클러스터 구성
롤링 업그레이드 절차를 제외하고, 복제 세트 또는 샤딩된 클러스터의 모든 구성 요소는 동일한 --clusterAuthMode
설정을 사용하여 배포의 다른 모든 구성 요소에 안전하게 연결할 수 있도록 해야 합니다.
복제본 세트 배포의 경우 여기에는 복제본 세트의 mongod
멤버가 모두 포함됩니다.
샤딩된 클러스터 배포의 경우, 여기에는 mongod
또는 mongos
인스턴스가 모두 포함됩니다.
참고
mongod
mongos
{ 2} 및 는 기본적으로 로컬 호스트에 바인딩됩니다. 배포 구성원이 다른 호스트에서 실행되거나 원격 클라이언트를 배포에 연결하려는 경우 --bind_ip
또는 net.bindIp
를 지정해야 합니다.
명령줄 옵션 사용(tls
)
참고
이 섹션의 절차에서는 tls
설정/옵션을 사용합니다. 더 이상 사용되지 않는 ssl
별칭을 사용하는 절차에 대해서는 명령줄 옵션 사용(ssl
)을 참조하세요.
MongoDB가 항상 TLS 1.0 이상을 지원해 왔기에 tls
설정/옵션은 ssl
옵션과 동일한 기능을 제공합니다.
mongod --replSet <name> --tlsMode requireTLS --clusterAuthMode x509 --tlsClusterFile <path to membership certificate and key PEM file> --tlsCertificateKeyFile <path to TLS/SSL certificate and key file> --tlsCAFile <path to root CA file> --bind_ip localhost,<hostname(s)|ip address(es)>
중요
To use X.509 authentication, --tlsCAFile
or net.tls.CAFile
must be specified unless you are using --tlsCertificateSelector
or --net.tls.certificateSelector
.
특정 구성에 필요한 추가 옵션(TLS/SSL 등)을 포함합니다. 다음의 경우:
security: clusterAuthMode: x509 net: tls: mode: requireTLS certificateKeyFile: <path to its TLS/SSL certificate and key file> CAFile: <path to root CA PEM file to verify received certificate> clusterFile: <path to its certificate key file for membership authentication> bindIp: localhost,<hostname(s)|ip address(es)>
중요
To use X.509 authentication, --tlsCAFile
or net.tls.CAFile
must be specified unless you are using --tlsCertificateSelector
or --net.tls.certificateSelector
.
특정 구성에 필요한 추가 옵션(TLS/SSL 등)을 포함합니다.
자세한 내용은 TLS/SSL을 위한 mongod
및 mongos
구성을 참조하세요.
명령줄 옵션 사용(ssl
)
참고
이 섹션의 절차에서는 더 이상 사용되지 않는 ssl
설정/옵션을 사용합니다. tls
별칭을 사용하는 절차에 대해서는 명령줄 옵션 사용(tls
)을 참조하세요.
MongoDB가 항상 TLS 1.0 이상을 지원해 왔기에 tls
설정/옵션은 ssl
옵션과 동일한 기능을 제공합니다.
To specify the X.509 certificate for internal cluster member
authentication, append the additional TLS/SSL options
--clusterAuthMode
and --sslClusterFile
, as in the
following example for a member of a replica set:
mongod --replSet <name> --sslMode requireSSL --clusterAuthMode x509 --sslClusterFile <path to membership certificate and key PEM file> --sslPEMKeyFile <path to TLS/SSL certificate and key PEM file> --sslCAFile <path to root CA PEM file> --bind_ip localhost,<hostname(s)|ip address(es)>
중요
To use X.509 authentication, --tlsCAFile
or net.tls.CAFile
must be specified unless you are using --tlsCertificateSelector
or --net.tls.certificateSelector
.
특정 구성에 필요한 추가 옵션(TLS/SSL 등)을 포함합니다.
security: clusterAuthMode: x509 net: ssl: mode: requireSSL PEMKeyFile: <path to TLS/SSL certificate and key PEM file> CAFile: <path to root CA PEM file> clusterFile: <path to X.509 membership certificate and key PEM file> bindIp: localhost,<hostname(s)|ip address(es)>
중요
To use X.509 authentication, --tlsCAFile
or net.tls.CAFile
must be specified unless you are using --tlsCertificateSelector
or --net.tls.certificateSelector
.
특정 구성에 필요한 추가 옵션(TLS/SSL 등)을 포함합니다.
자세한 내용은 TLS/SSL을 위한 mongod
및 mongos
구성을 참조하세요.
추가 정보
키 파일 내부 인증 에서 X.509 내부 인증 으로 업그레이드 하려면 자체 관리형 MongoDB 키 파일 인증에서 X. 인증으로509 업그레이드를 참조하세요.
To perform a rolling update of the certificates to new certificates
with different DN
, see
Rotate X.509 Certificates without clusterAuthX509 Attributes on Self-Managed Clusters.