Obtain server certificates to enable TLS encryption for your self-managed MongoDB replica set deployments.
重要
These steps apply to self-managed MongoDB deployments. MongoDB Atlas clusters use TLS by default. If you use Cloud Manager or Ops Manager, configure TLS through your deployment management tool.
始める前に
開始する前に、次の情報とリソースがあることを確認してください。
TLSで保護したい自己管理型 MongoDB レプリカセットの配置があります。
後のチュートリアルで TLS 接続を確認するには、配置で少なくとも 1 つの管理ユーザーが有効になっている必要があります。X.509 クライアント認証を有効にする場合、管理ユーザーは
$externalデータベースでユーザーを作成および変更するために、少なくともuserAdminロールを持っている必要があります。You have a hostname for each node in your deployment, such as
mongo0.example.com,mongo1.example.com, andmongo2.example.com. If you are using a public CA, you must have a registered domain name that corresponds to these hostnames.You have OpenSSL installed on your machine.
If you are planning on using a public CA, such as Let's Encrypt or DigiCert, you know which public CA you are using. If you are planning on using a private CA, you have access to your organization's PKI information. The process for obtaining certificates might be different based on the CA you use. However, you must end with the same
.pemfiles described in the final result section of this tutorial.お好みのコマンドラインインターフェイスが開いていることを確認します。
You know your deployment TLS configuration requirements and whether your certificates need
clientAuthEKU based on the TLS Planning page.
手順
このチュートリアルでは、配置の最初のノードに対して mongo0.pem と呼ばれる 1 つの証明書を作成します。追加ノードの証明書を生成する場合は、ファイル名は具体的に指定してください。例として、最初のセカンダリの証明書に mongo1.pem と名付けます。
最終結果
このチュートリアルの最後には、/etc/ssl/mongodb に次の .pem ファイルがあります。
各ノードには、そのノードの証明書と秘密キーを含む
.pemファイルがあります。例:mongo0.pem、mongo1.pem、mongo2.pem配置全体には、
ca.pemなどの各ノードの証明書を発行した中間 CA 証明書があります。
次のステップ
自己管理型 MongoDB 配置の TLS を構成する方法を学ぶには、次のチュートリアル「自己管理型配置の TLS を構成する。」を参照してください。