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 ごとに実行します。
手順
Capsule Server で、すべてのソース証明書ファイルを含むディレクトリーを作成し、
root
ユーザーのみがアクセスできるようにします。# mkdir /root/capsule_cert # cd /root/capsule_cert
Certificate Signing Request (CSR) を署名する秘密鍵を作成します。
秘密鍵は暗号化する必要がないことに注意してください。パスワードで保護された秘密鍵を使用する場合は、秘密鍵のパスワードを削除します。
この Capsule Server の秘密鍵がすでにある場合は、この手順を省略します。
# openssl genrsa -out /root/capsule_cert/capsule_cert_key.pem 4096
証明書要求設定ファイルを作成して、次の内容を追加します。
[ req ] default_bits = 4096 distinguished_name = req_distinguished_name req_extensions = req_ext prompt = no [ req_distinguished_name ] countryName=2 Letter Country Code stateOrProvinceName=State or Province Full Name localityName=Locality Name 0.organizationName=Organization Name organizationalUnitName=Capsule Organization Unit Name commonName=capsule.example.com 1 emailAddress=Email Address [ req_ext ] #authorityKeyIdentifier=keyid,issuer #basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment subjectAltName = @alt_names [alt_names] 2 DNS.1 = loadbalancer.example.com DNS.2 = capsule.example.com
SAN 証明書の Certificate Signing Request (CSR) を作成します。
# openssl req -new \ -key /root/capsule_cert/capsule_cert_key.pem \ 1 -config SAN_config.cfg \ 2 -out /root/capsule_cert/capsule_cert_csr.pem 3
証明書要求を認証局に送信します。
要求を送信する場合は、証明書の有効期限を指定してください。証明書要求を送信する方法は異なるため、推奨される方法について認証局にお問い合わせください。要求への応答で、認証局バンドルと署名済み証明書を別々のファイルで受け取ることになります。
- 認証局バンドル、認証局から受け取る Capsule Server の証明書ファイル、Capsule Server の秘密鍵を、Satellite Server にコピーします。
Satellite Server で、Capsule Server 証明書入力ファイルを検証します。
# katello-certs-check \ -c /root/capsule_cert/capsule_cert.pem \ 1 -k /root/capsule_cert/capsule_cert_key.pem \ 2 -b /root/capsule_cert/ca_cert_bundle.pem 3
commonName=
をワイルドカードの値*
に設定する場合には、-t capsule
オプションをkatello-certs-check
コマンドに追加する必要があります。katello-certs-check
コマンドの出力であるcapsule-certs-generate
コマンドの例をメモして、この Capsule Server の認証アーカイブファイルを作成します。
4.3.2. カスタム SSL 証明書を使用する Capsule Server のロードバランシング用の設定 (Puppet を使用しない)
次のセクションでは、Puppet を使用せず、カスタム SSL 証明書を使用する Capsule Server をロードバランシング用に設定する方法を説明します。この手順は、ロードバランシング用に設定する Capsule Server ごとに実行します。
手順
katello-certs-check
コマンドの出力から取得するcapsule-certs-generate
コマンドに次のオプションを追加します。--foreman-proxy-cname loadbalancer.example.com
Satellite Server で、
capsule-certs-generate
コマンドを入力して Capsule 証明書を生成します。# 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 にコピーします。
# scp /root/capsule.example.com-certs.tar root@capsule.example.com:capsule.example.com-certs.tar
capsule-certs-generate
コマンドの出力から取得するsatellite-installer
コマンドに次のオプションを追加します。--certs-cname "loadbalancer.example.com" \ --enable-foreman-proxy-plugin-remote-execution-script
Capsule Server で、
satellite-installer
コマンドを入力します。# 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"