4.3. カスタム SSL 証明書を使用する Capsule Server のロードバランシング用の設定 (Puppet を使用しない)
次のセクションでは、Puppet を使用せず、カスタム SSL 証明書を使用する Capsule Server をロードバランシング用に設定する方法を説明します。
4.3.1. Capsule Server のカスタム SSL 証明書の作成
以下の手順では、Certificate Signing Request (CSR) の設定ファイルを作成して、Subject Alternative Names (SAN) としてロードバランサーと Capsule Server を追加する方法を説明します。この手順は、ロードバランシング用に設定する Capsule Server ごとに実行します。
手順
ソースの証明書ファイルすべてを保存するには、
root
ユーザーだけがアクセスできるディレクトリーを作成します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow mkdir /root/capsule_cert
# mkdir /root/capsule_cert
証明書署名要求 (CSR) に署名する秘密鍵を作成します。
秘密鍵は暗号化する必要がないことに注意してください。パスワードで保護された秘密鍵を使用する場合は、秘密鍵のパスワードを削除します。
この Capsule Server の秘密鍵がすでにある場合は、この手順を省略します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow openssl genrsa -out /root/capsule_cert/capsule_cert_key.pem 4096
# openssl genrsa -out /root/capsule_cert/capsule_cert_key.pem 4096
CSR 用の
/root/capsule_cert/openssl.cnf
設定ファイルを作成して、以下のコンテンツを追加します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow [ req ] req_extensions = v3_req distinguished_name = req_distinguished_name x509_extensions = usr_cert prompt = no [ req_distinguished_name ] commonName = capsule.example.com [ v3_req ] basicConstraints = CA:FALSE keyUsage = digitalSignature, keyEncipherment extendedKeyUsage = serverAuth, clientAuth subjectAltName = @alt_names [alt_names] DNS.1 = loadbalancer.example.com DNS.2 = capsule.example.com
[ req ] req_extensions = v3_req distinguished_name = req_distinguished_name x509_extensions = usr_cert prompt = no [ req_distinguished_name ] commonName = capsule.example.com
1 [ v3_req ] basicConstraints = CA:FALSE keyUsage = digitalSignature, keyEncipherment extendedKeyUsage = serverAuth, clientAuth subjectAltName = @alt_names [alt_names]
2 DNS.1 = loadbalancer.example.com DNS.2 = capsule.example.com
[ v3_req ]
パラメーターとその目的に関する詳細は、RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile を参照してください。オプション: CSR に識別名 (DN) の詳細を追加する場合は、
[ req_distinguished_name ]
セクションに次の情報を追加します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow [req_distinguished_name] CN = capsule.example.com countryName =My_Country_Name stateOrProvinceName = My_State_Or_Province_Name localityName = My_Locality_Name organizationName = My_Organization_Or_Company_Name organizationalUnitName = My_Organizational_Unit_Name
[req_distinguished_name] CN = capsule.example.com countryName =My_Country_Name
1 stateOrProvinceName = My_State_Or_Province_Name
2 localityName = My_Locality_Name
3 organizationName = My_Organization_Or_Company_Name organizationalUnitName = My_Organizational_Unit_Name
4 CSR を生成します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow openssl req -new \ -key /root/capsule_cert/capsule_cert_key.pem \ -config /root/capsule_cert/openssl.cnf \ -out /root/capsule_cert/capsule_cert_csr.pem
# openssl req -new \ -key /root/capsule_cert/capsule_cert_key.pem \
1 -config /root/capsule_cert/openssl.cnf \
2 -out /root/capsule_cert/capsule_cert_csr.pem
3 認証局 (CA) に証明書署名要求を送信します。Satellite Server と Capsule Server の証明書には同じ CA が署名する必要があります。
要求を送信する場合は、証明書の有効期限を指定してください。証明書要求の送信方法にはさまざまなものがあるため、推奨される方法を CA にお問い合わせください。要求すると、CA バンドルと署名済み証明書を別々のファイルで受け取ることになります。
- 認証局バンドル、認証局から受け取る Capsule Server の証明書ファイル、Capsule Server の秘密鍵を、Satellite Server にコピーします。
- Satellite Server で、Capsule Server 証明書入力ファイルを検証します。
katello-certs-check \ -c /root/{cert-name}_cert/{cert-name}_cert.pem \ -k /root/{cert-name}_cert/{cert-name}_cert_key.pem \ -b /root/{cert-name}_cert/ca_cert_bundle.pem
# katello-certs-check \
-c /root/{cert-name}_cert/{cert-name}_cert.pem \
-k /root/{cert-name}_cert/{cert-name}_cert_key.pem \
-b /root/{cert-name}_cert/ca_cert_bundle.pem
4.3.2. カスタム SSL 証明書を使用する Capsule Server のロードバランシング用の設定 (Puppet を使用しない)
次のセクションでは、Puppet を使用せず、カスタム SSL 証明書を使用する Capsule Server をロードバランシング用に設定する方法を説明します。この手順は、ロードバランシング用に設定する Capsule Server ごとに実行します。
手順
katello-certs-check
コマンドの出力から取得するcapsule-certs-generate
コマンドに次のオプションを追加します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow --foreman-proxy-cname loadbalancer.example.com
--foreman-proxy-cname loadbalancer.example.com
Satellite Server で、
capsule-certs-generate
コマンドを入力して Capsule 証明書を生成します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow capsule-certs-generate \ --certs-tar /root/capsule_cert/capsule.tar \ --foreman-proxy-cname loadbalancer.example.com \ --foreman-proxy-fqdn capsule.example.com \ --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem \ --server-cert /root/capsule_cert/capsule.pem \ --server-key /root/capsule_cert/capsule.pem
# capsule-certs-generate \ --certs-tar /root/capsule_cert/capsule.tar \ --foreman-proxy-cname loadbalancer.example.com \ --foreman-proxy-fqdn capsule.example.com \ --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem \ --server-cert /root/capsule_cert/capsule.pem \ --server-key /root/capsule_cert/capsule.pem
出力からの
satellite-installer
コマンド例のコピーを保持し、Capsule Server 証明書をインストールします。証明書アーカイブファイルを Satellite Server から Capsule Server にコピーします。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow scp /root/capsule.example.com-certs.tar root@capsule.example.com:capsule.example.com-certs.tar
# scp /root/capsule.example.com-certs.tar root@capsule.example.com:capsule.example.com-certs.tar
capsule-certs-generate
コマンドの出力から取得するsatellite-installer
コマンドに次のオプションを追加します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow --certs-cname "loadbalancer.example.com" \ --enable-foreman-proxy-plugin-remote-execution-script
--certs-cname "loadbalancer.example.com" \ --enable-foreman-proxy-plugin-remote-execution-script
Capsule Server で、
satellite-installer
コマンドを入力します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow satellite-installer --scenario capsule \ --certs-cname "loadbalancer.example.com" \ --certs-tar-file "capsule.example.com-certs.tar" \ --enable-foreman-proxy-plugin-remote-execution-script \ --foreman-proxy-foreman-base-url "https://satellite.example.com" \ --foreman-proxy-oauth-consumer-key "oauth key" \ --foreman-proxy-oauth-consumer-secret "oauth secret" \ --foreman-proxy-register-in-foreman "true" \ --foreman-proxy-trusted-hosts "satellite.example.com" \ --foreman-proxy-trusted-hosts "capsule.example.com"
# satellite-installer --scenario capsule \ --certs-cname "loadbalancer.example.com" \ --certs-tar-file "capsule.example.com-certs.tar" \ --enable-foreman-proxy-plugin-remote-execution-script \ --foreman-proxy-foreman-base-url "https://satellite.example.com" \ --foreman-proxy-oauth-consumer-key "oauth key" \ --foreman-proxy-oauth-consumer-secret "oauth secret" \ --foreman-proxy-register-in-foreman "true" \ --foreman-proxy-trusted-hosts "satellite.example.com" \ --foreman-proxy-trusted-hosts "capsule.example.com"