4.3. カスタム SSL 証明書を使用する Capsule Server のロードバランシング用の設定 (Puppet を使用しない)
次のセクションでは、Puppet を使用せず、カスタム SSL 証明書を使用する Capsule Server をロードバランシング用に設定する方法を説明します。
4.3.1. Capsule Server のカスタム SSL 証明書の作成
以下の手順は、証明書署名要求 (CSR) の設定ファイルを作成して、サブジェクトの別名としてロードバランサーと Capsule Server を追加する方法を説明します。この手順は、ロードバランシング用に設定する Capsule Server ごとに実行します。
手順
Capsule Server で、すべてのソース証明書ファイルを含むディレクトリーを作成し、
root
ユーザーのみがアクセスできるようにします。Copy to Clipboard Copied! Toggle word wrap Toggle overflow mkdir /root/capsule_cert cd /root/capsule_cert
# mkdir /root/capsule_cert # cd /root/capsule_cert
Certificate Signing Request (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
証明書要求設定ファイルを作成して、次の内容を追加します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow [ 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 emailAddress=Email Address [ req_ext ] #authorityKeyIdentifier=keyid,issuer #basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment subjectAltName = @alt_names [alt_names] DNS.1 = loadbalancer.example.com DNS.2 = capsule.example.com
[ 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 証明書の証明書署名要求 (CSR) を作成します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow openssl req -new \ -key /root/capsule_cert/capsule_cert_key.pem \ -config SAN_config.cfg \ -out /root/capsule_cert/capsule_cert_csr.pem
# 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 証明書入力ファイルを検証します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow katello-certs-check \ -c /root/capsule_cert/capsule_cert.pem \ -k /root/capsule_cert/capsule_cert_key.pem \ -b /root/capsule_cert/ca_cert_bundle.pem
# 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 を使用しない)
この手順は、ロードバランシング用に設定する 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 \ --foreman-proxy-fqdn capsule.example.com \ --certs-tar /root/capsule_cert/capsule.tar \ --server-cert /root/capsule_cert/capsule.pem \ --server-key /root/capsule_cert/capsule.pem \ --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem \ --foreman-proxy-cname loadbalancer.example.com
# capsule-certs-generate \ --foreman-proxy-fqdn capsule.example.com \ --certs-tar /root/capsule_cert/capsule.tar \ --server-cert /root/capsule_cert/capsule.pem \ --server-key /root/capsule_cert/capsule.pem \ --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem \ --foreman-proxy-cname loadbalancer.example.com
出力からの
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
コマンドに次のオプションを追加します。コマンドの入力先の Capsule Server を参照するように、--puppet-ca-server
オプションを設定します。Puppet CA は、使用する予定があるかどうかに関係なく、Capsule Server にインストールする必要があります。Puppet は、デフォルトの単一ノード設定に設定されます。Copy to Clipboard Copied! Toggle word wrap Toggle overflow --certs-cname "loadbalancer.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-ca-server "capsule.example.com" \ --foreman-proxy-puppetca "true" \ --puppet-server-ca "true" \ --enable-foreman-proxy-plugin-remote-execution-ssh
--certs-cname "loadbalancer.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-ca-server "capsule.example.com" \ --foreman-proxy-puppetca "true" \ --puppet-server-ca "true" \ --enable-foreman-proxy-plugin-remote-execution-ssh
以下のように、Capsule Server で、
satellite-installer
コマンドを実行します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow satellite-installer --scenario capsule \ --foreman-proxy-register-in-foreman "true" \ --foreman-proxy-foreman-base-url "https://satellite.example.com" \ --foreman-proxy-trusted-hosts "satellite.example.com" \ --foreman-proxy-trusted-hosts "capsule.example.com" \ --foreman-proxy-oauth-consumer-key "oauth key" \ --foreman-proxy-oauth-consumer-secret "oauth secret" \ --certs-tar-file "capsule.example.com-certs.tar" \ --puppet-server-foreman-url "https://satellite.example.com" \ --certs-cname "loadbalancer.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-ca-server "capsule.example.com" \ --foreman-proxy-puppetca "true" \ --puppet-server-ca "true" \ --enable-foreman-proxy-plugin-remote-execution-ssh
# satellite-installer --scenario capsule \ --foreman-proxy-register-in-foreman "true" \ --foreman-proxy-foreman-base-url "https://satellite.example.com" \ --foreman-proxy-trusted-hosts "satellite.example.com" \ --foreman-proxy-trusted-hosts "capsule.example.com" \ --foreman-proxy-oauth-consumer-key "oauth key" \ --foreman-proxy-oauth-consumer-secret "oauth secret" \ --certs-tar-file "capsule.example.com-certs.tar" \ --puppet-server-foreman-url "https://satellite.example.com" \ --certs-cname "loadbalancer.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-ca-server "capsule.example.com" \ --foreman-proxy-puppetca "true" \ --puppet-server-ca "true" \ --enable-foreman-proxy-plugin-remote-execution-ssh