2.5. 使用 SSL 证书配置 Capsule 服务器
Red Hat Satellite 使用 SSL 证书启用 Satellite 服务器、外部胶囊服务器和所有主机之间的加密通信。根据您的机构要求,您必须使用默认或自定义证书配置 Capsule 服务器。
- 如果使用默认 SSL 证书,还必须为每个外部 Capsule 服务器配置不同的默认 SSL 证书。更多信息请参阅 第 2.5.1 节 “使用默认 SSL 证书配置 Capsule 服务器”。
- 如果使用自定义 SSL 证书,还必须为每个外部 Capsule 服务器配置不同的自定义 SSL 证书。更多信息请参阅 第 2.5.2 节 “使用自定义 SSL 证书配置 Capsule 服务器”。
2.5.1. 使用默认 SSL 证书配置 Capsule 服务器 复制链接链接已复制到粘贴板!
使用本节为胶囊服务器配置由 Satellite 服务器默认证书颁发机构(CA)签名的 SSL 证书。
先决条件
- 胶囊服务器已注册到 Satellite 服务器。如需更多信息,请参阅 注册到 Satellite 服务器。
- 安装了胶囊服务器软件包。如需更多信息,请参阅安装 Capsule 服务器软件包。
流程
在 Satellite 服务器上,要为您的胶囊服务器存储所有源证书文件,请创建一个只能被
root
用户访问的目录,如/root/capsule_cert
:mkdir /root/capsule_cert
# mkdir /root/capsule_cert
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在 Satellite 服务器上,为您的 Capsule 服务器生成
/root/capsule_cert/ Capsule.example.com-certs.tar
证书存档:capsule-certs-generate \ --foreman-proxy-fqdn capsule.example.com \ --certs-tar /root/capsule_cert/capsule.example.com-certs.tar
# capsule-certs-generate \ --foreman-proxy-fqdn capsule.example.com \ --certs-tar /root/capsule_cert/capsule.example.com-certs.tar
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 保留 Capsule-
certs-generate 命令返回的
命令的副本,以将证书部署到您的胶囊服务器。satellite-
installerCapsule
-certs-generate 的输出示例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在 Satellite 服务器上,将证书归档文件复制到您的 Capsule 服务器中:
scp /root/capsule_cert/capsule.example.com-certs.tar \ root@capsule.example.com:/root/capsule.example.com-certs.tar
# scp /root/capsule_cert/capsule.example.com-certs.tar \ root@capsule.example.com:/root/capsule.example.com-certs.tar
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在 Capsule 服务器上,若要部署证书,请输入 Capsule-
certs-generate 命令返回的
命令。satellite-
installer当到 Satellite 的网络连接或端口尚未打开时,您可以将
--foreman-proxy-register-in-foreman
选项设置为false
,以防止 Capsule 尝试连接到 Satellite 并报告错误。当网络和防火墙正确配置时,再次运行安装程序,并将此选项设置为true
。重要部署证书后不要删除证书存档文件。例如,在升级胶囊服务器时是必需的。
2.5.2. 使用自定义 SSL 证书配置 Capsule 服务器 复制链接链接已复制到粘贴板!
如果将 Satellite 服务器配置为使用自定义 SSL 证书,还必须将每个外部 Capsule 服务器配置为使用不同的自定义 SSL 证书。
要使用自定义证书配置您的 Capsule 服务器,在每个 Capsule 服务器上完成以下步骤:
2.5.2.1. 为 Capsule 服务器创建自定义 SSL 证书 复制链接链接已复制到粘贴板!
在受管主机上,为您的胶囊服务器创建一个自定义证书。如果您已经为 Capsule 服务器有自定义 SSL 证书,请跳过这个过程。
流程
要存储所有源证书文件,请创建一个只能被
root
用户访问的目录:mkdir /root/capsule_cert
# mkdir /root/capsule_cert
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 创建为证书签名请求(CSR)签名的私钥。
请注意,私钥必须未加密。如果您使用密码保护的私钥,请删除私钥密码。
如果您已有此胶囊服务器的私钥,请跳过这一步。
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 -
为 CSR 创建
/root/capsule_cert/openssl.cnf
配置文件并包含以下内容:
可选: 如果要向 CSR 添加可辨识名称(DN)详情,请在
[ req_distinguished_name ]
部分添加以下信息:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 生成 CSR:
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 Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将证书签名请求发送到证书颁发机构(CA)。同一 CA 必须为 Satellite 服务器和 Capsule 服务器签名证书。
提交请求时,指定证书的寿命。发送证书请求的方法会有所不同,因此请查阅 CA 查看首选方法。为了响应请求,您可以在单独的文件中接收 CA 捆绑包和签名证书。
2.5.2.2. 将自定义 SSL 证书部署到 Capsule 服务器 复制链接链接已复制到粘贴板!
使用这个流程,使用证书颁发机构签名的自定义 SSL 证书配置您的 Capsule 服务器。satellite-installer
命令返回 Capsule -certs-generate
命令对于每个胶囊服务器都是唯一的。不要在多个胶囊服务器上使用相同的命令。
先决条件
- Satellite 服务器配置了自定义证书。如需更多信息,请参阅 在 连接的网络环境中安装 Satellite 服务器 中的 使用自定义 SSL 证书配置 Satellite 服务器。
- 胶囊服务器已注册到 Satellite 服务器。如需更多信息,请参阅 注册到 Satellite 服务器。
- 安装了胶囊服务器软件包。如需更多信息,请参阅安装 Capsule 服务器软件包。
流程
在 Satellite 服务器上,验证自定义 SSL 证书输入文件:
katello-certs-check \ -t capsule \ -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 \ -t capsule \ -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 Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果您在
/root/capsule_cert/openssl.cnf
配置文件中为证书的 Common NameCN =
设置通配符值,您必须将-t Capsule 选项添加到
katello-certs-check
命令中。如果命令成功,它会返回两个 Capsule
-certs-generate 命令,其中之一必须使用它来为您的胶囊服务器
生成证书存档文件。katello-certs-check
的输出示例Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在受管主机上,从
katello-certs-check
命令的输出中根据您的要求,输入 Capsule-certs-generate
命令,为新的或现有胶囊生成证书。在这个命令中,将
CAPSULE
更改为 Capsule 服务器的 FQDN。保留 Capsule-
certs-generate 命令返回的
命令的副本,以将证书部署到您的胶囊服务器。satellite-
installerCapsule
-certs-generate 的输出示例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在 Satellite 服务器上,将证书归档文件复制到您的 Capsule 服务器中:
scp /root/capsule_cert/capsule.example.com-certs.tar \ root@capsule.example.com:/root/capsule.example.com-certs.tar
# scp /root/capsule_cert/capsule.example.com-certs.tar \ root@capsule.example.com:/root/capsule.example.com-certs.tar
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在 Capsule 服务器上,若要部署证书,请输入 Capsule-
certs-generate 命令返回的
命令。satellite-
installer如果 Satellite 的网络连接或端口尚未打开,您可以将
--foreman-proxy-register-in-foreman
选项设置为false
,以防止 Capsule 尝试连接到 Satellite 并报告错误。当网络和防火墙正确配置时,再次运行安装程序,并将此选项设置为true
。重要部署证书后不要删除证书存档文件。例如,在升级胶囊服务器时是必需的。
2.5.2.3. 将自定义 SSL 证书部署到主机 复制链接链接已复制到粘贴板!
在将 Capsule 服务器配置为使用自定义 SSL 证书后,还必须在注册到此 Capsule 服务器的每个主机上安装 katello-ca-consumer
软件包。
流程
在每个主机上安装
katello-ca-consumer
软件包:dnf install http://capsule.example.com/pub/katello-ca-consumer-latest.noarch.rpm
# dnf install http://capsule.example.com/pub/katello-ca-consumer-latest.noarch.rpm
Copy to Clipboard Copied! Toggle word wrap Toggle overflow