4.4. カスタム SSL 証明書を使用する Capsule Server のロードバランシング用の設定 (Puppet を使用する)
Satellite 設定で Puppet を使用する場合は、次の手順を実行する必要があります。
4.4.1. Capsule Server のカスタム SSL 証明書の作成 リンクのコピーリンクがクリップボードにコピーされました!
以下の手順では、Certificate Signing Request (CSR) の設定ファイルを作成して、Subject Alternative Names (SAN) としてロードバランサーと Capsule Server を追加する方法を説明します。この手順は、ロードバランシング用に設定する Capsule Server ごとに実行します。
手順
ソースの証明書ファイルすべてを保存するには、
rootユーザーだけがアクセスできるディレクトリーを作成します。# mkdir /root/capsule_cert証明書署名要求 (CSR) に署名する秘密鍵を作成します。
秘密鍵は暗号化する必要がないことに注意してください。パスワードで保護された秘密鍵を使用する場合は、秘密鍵のパスワードを削除します。
この Capsule Server の秘密鍵がすでにある場合は、この手順を省略します。
# openssl genrsa -out /root/capsule_cert/capsule_cert_key.pem 4096CSR 用の
/root/capsule_cert/openssl.cnf設定ファイルを作成して、以下のコンテンツを追加します。[ req ] req_extensions = v3_req distinguished_name = req_distinguished_name x509_extensions = usr_cert prompt = no [ req_distinguished_name ] commonName = capsule.example.com1 [ v3_req ] basicConstraints = CA:FALSE keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment extendedKeyUsage = serverAuth, clientAuth, codeSigning, emailProtection subjectAltName = @alt_names [alt_names]2 DNS.1 = loadbalancer.example.com DNS.2 = capsule.example.comオプション: CSR に識別名 (DN) の詳細を追加する場合は、
[ req_distinguished_name ]セクションに次の情報を追加します。[req_distinguished_name] CN = capsule.example.com countryName =My_Country_Name1 stateOrProvinceName = My_State_Or_Province_Name2 localityName = My_Locality_Name3 organizationName = My_Organization_Or_Company_Name organizationalUnitName = My_Organizational_Unit_Name4 CSR を生成します。
# 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.pem3 認証局 (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
4.4.2. Puppet 証明書を生成および署名するためのカスタム SSL 証明書を使用した Capsule Server の設定 リンクのコピーリンクがクリップボードにコピーされました!
この手順は、ロードバランシング用に設定した他の Capsule Server すべてに、Puppet 証明書を生成するように Capsule Server を設定するシステムにのみ、実行してください。
手順
katello-certs-checkコマンドの出力から取得するcapsule-certs-generateコマンドに次のオプションを追加します。--foreman-proxy-cname loadbalancer.example.comSatellite Server で、
capsule-certs-generateコマンドを入力して Capsule 証明書を生成します。# capsule-certs-generate \ --certs-tar /root/capsule_cert/capsule-ca.tar \ --foreman-proxy-cname loadbalancer.example.com \ --foreman-proxy-fqdn capsule-ca.example.com \ --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem \ --server-cert /root/capsule_cert/capsule-ca.pem \ --server-key /root/capsule_cert/capsule-ca.pem出力からの
satellite-installerコマンド例のコピーを保持し、Capsule Server 証明書をインストールします。- 証明書アーカイブファイルを Satellite Server から Capsule Server にコピーします。
capsule-certs-generateコマンドの出力から取得するsatellite-installerコマンドに次のオプションを追加します。--enable-foreman-proxy-plugin-remote-execution-script \ --foreman-proxy-puppetca "true" \ --puppet-ca-server "capsule-ca.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-server-ca "true"Capsule Server で、
satellite-installerコマンドを入力します。# satellite-installer --scenario capsule \ --certs-cname "loadbalancer.example.com" \ --certs-tar-file "certs.tgz" \ --enable-foreman-proxy-plugin-remote-execution-script \ --enable-puppet \ --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-puppetca "true" \ --foreman-proxy-register-in-foreman "true" \ --foreman-proxy-trusted-hosts "satellite.example.com" \ --foreman-proxy-trusted-hosts "capsule-ca.example.com" \ --puppet-ca-server "capsule-ca.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-server true \ --puppet-server-ca "true" \ --puppet-server-foreman-url "https://satellite.example.com"Puppetserver 認証局である Capsule Server で、Puppet サーバーを停止します。
# systemctl stop puppetserverロードバランシングを設定する他のすべての Capsule Server に対して Puppet 証明書を生成します。ただし、Puppet 証明書署名を最初に設定したシステムを除きます。
# puppetserver ca generate \ --ca-client \ --certname capsule.example.com \ --subject-alt-names loadbalancer.example.comこのコマンドは、以下のファイルを作成します。
-
/etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem -
/etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem -
/etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem -
/etc/puppetlabs/puppetserver/ca/signed/capsule.example.com.pem
-
Puppet サーバーを再起動します。
# systemctl start puppetserver
4.4.3. ロードバランシング向けにカスタム SSL 証明書を使用した残りの Capsule Server の設定 リンクのコピーリンクがクリップボードにコピーされました!
この手順は、Puppet 証明書に署名するために Capsule Server を設定するシステムを除き、各 Capsule Server で実行します。
手順
katello-certs-checkコマンドの出力から取得するcapsule-certs-generateコマンドに次のオプションを追加します。--foreman-proxy-cname loadbalancer.example.comSatellite 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.tarCapsule Server で、
puppetserverパッケージをインストールします。# satellite-maintain packages install puppetserverCapsule Server で、Puppet 証明書用のディレクトリーを作成します。
# mkdir -p /etc/puppetlabs/puppet/ssl/certs/ \ /etc/puppetlabs/puppet/ssl/private_keys/ \ /etc/puppetlabs/puppet/ssl/public_keys/Capsule Server で、Capsule Server を設定するシステムから、対象の Capsule Server の Puppet 証明書をコピーして、Puppet 証明書を署名します。
# scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/ca.pem /etc/puppetlabs/puppet/ssl/certs/ca.pem # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pemCapsule Server で、
/etc/puppetlabs/puppet/ssl/ディレクトリーの所有権をユーザーpuppetおよびグループpuppetに変更します。# chown -R puppet:puppet /etc/puppetlabs/puppet/ssl/Capsule Server で、
/etc/puppetlabs/puppet/ssl/ディレクトリーの SELinux コンテキストを設定します。# restorecon -Rv /etc/puppetlabs/puppet/ssl/capsule-certs-generateコマンドの出力から取得するsatellite-installerコマンドに次のオプションを追加します。--certs-cname "loadbalancer.example.com" \ --enable-foreman-proxy-plugin-remote-execution-script \ --foreman-proxy-puppetca "false" \ --puppet-ca-server "capsule-ca.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-server-ca "false"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-puppetca "false" \ --foreman-proxy-register-in-foreman "true" \ --foreman-proxy-trusted-hosts "satellite.example.com" \ --foreman-proxy-trusted-hosts "capsule.example.com" \ --puppet-ca-server "capsule-ca.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-server-ca "false" \ --puppet-server-foreman-url "https://satellite.example.com"