4.12. 使用自定义 SSL 证书配置 Satellite 服务器
默认情况下,红帽卫星 6 使用自签名 SSL 证书来启用卫星服务器、外部胶囊服务器和所有主机之间的加密通信。如果无法使用卫星自签名证书,您可以将卫星服务器配置为使用由外部证书颁发机构签名的 SSL 证书。
要使用自定义证书配置 Satellite 服务器,请完成以下步骤:
- 第 4.12.1 节 “为卫星服务器创建自定义 SSL 证书”
- 第 4.12.2 节 “将自定义 SSL 证书部署到卫星服务器”
- 第 4.12.3 节 “将自定义 SSL 证书部署到主机”
- 如果将外部胶囊服务器注册到卫星服务器,则必须使用自定义 SSL 证书来配置它们。相同的证书颁发机构必须签署卫星服务器和胶囊服务器的证书。有关更多信息,请参阅在安装胶囊服务器中使用自定义 SSL 证书 配置胶囊服务器。
4.12.1. 为卫星服务器创建自定义 SSL 证书 复制链接链接已复制到粘贴板!
使用此流程为卫星服务器创建自定义 SSL 证书。如果您已经有适用于卫星服务器的自定义 SSL 证书,请跳过此步骤。
使用自定义证书配置 Satellite 服务器时,请注意以下注意事项:
- 您必须将 Privacy-Enhanced Mail (PEM)编码用于 SSL 证书。
- 您不能对卫星服务器和胶囊服务器使用相同的证书。
- 相同的证书颁发机构必须签署卫星服务器和胶囊服务器的证书。
流程
要存储所有源证书文件,请创建一个只可由
root
用户访问的目录。mkdir /root/satellite_cert
# mkdir /root/satellite_cert
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 创建为证书签名请求(CSR)签名的私钥。
请注意,私钥必须未加密。如果您使用受密码保护的私钥,请删除私钥密码。
如果您已拥有此卫星服务器的私钥,请跳过这一步。
openssl genrsa -out /root/satellite_cert/satellite_cert_key.pem 4096
# openssl genrsa -out /root/satellite_cert/satellite_cert_key.pem 4096
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 为证书签名请求(CSR)创建
/root/satellite_cert/openssl.cnf
配置文件,并包含以下内容:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 生成证书签名请求(CSR):
openssl req -new \ -key /root/satellite_cert/satellite_cert_key.pem \ -config /root/satellite_cert/openssl.cnf \ -out /root/satellite_cert/satellite_cert_csr.pem
# openssl req -new \ -key /root/satellite_cert/satellite_cert_key.pem \
1 -config /root/satellite_cert/openssl.cnf \
2 -out /root/satellite_cert/satellite_cert_csr.pem
3 Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将证书签名请求发送到证书颁发机构。相同的证书颁发机构必须签署卫星服务器和胶囊服务器的证书。
提交请求时,指定证书的 lifespan。发送证书请求的方法会有所不同,因此请查阅证书颁发机构来获得首选方法。为响应请求,预计可在单独的文件中接收证书颁发机构捆绑包和签名证书。
4.12.2. 将自定义 SSL 证书部署到卫星服务器 复制链接链接已复制到粘贴板!
使用此流程将卫星服务器配置为使用由证书颁发机构签名的自定义 SSL 证书。katello-certs-check
命令验证输入证书文件,并将自定义 SSL 证书部署到卫星服务器所需的命令返回。
流程
验证自定义 SSL 证书输入文件。请注意,对于
katello-certs-check
命令正常工作,证书中的通用名称(CN)必须与卫星服务器的 FQDN 匹配。katello-certs-check \ -c /root/satellite_cert/satellite_cert.pem \ -k /root/satellite_cert/satellite_cert_key.pem \ -b /root/satellite_cert/ca_cert_bundle.pem
# katello-certs-check \ -c /root/satellite_cert/satellite_cert.pem \
1 -k /root/satellite_cert/satellite_cert_key.pem \
2 -b /root/satellite_cert/ca_cert_bundle.pem
3 Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果命令成功,它会返回两个
satellite-installer
命令,其中一个命令必须使用它来将证书部署到卫星服务器。要使用自定义证书安装 Red Hat Satellite 服务器,请运行:
satellite-installer --scenario satellite \ --certs-server-cert "/root/satellite_cert/satellite.example.com_cert.pem" \ --certs-server-key "/root/satellite_cert/satellite.example.com_cert_key.pem" \ --certs-server-ca-cert "/root/satellite_cert/CA-Chain.pem"
satellite-installer --scenario satellite \ --certs-server-cert "/root/satellite_cert/satellite.example.com_cert.pem" \ --certs-server-key "/root/satellite_cert/satellite.example.com_cert_key.pem" \ --certs-server-ca-cert "/root/satellite_cert/CA-Chain.pem"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 要更新当前运行的 Satellite 安装中的证书,请运行:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 根据您的要求,输入
satellite-installer
命令,该命令使用自定义 SSL 证书安装新的卫星服务器,或在当前运行的卫星服务器上更新证书。在某些情况下,katello-certs-check
命令的输出可能并不准确。因此,您必须遵循上述步骤,而不是命令输出。如果您不确定要运行哪些命令,可以通过检查
/etc/foreman-installer/scenarios.d/.installed
.d/.installed 文件来验证是否安装了卫星。如果文件存在,请运行更新证书的第二个satellite-installer
命令。重要部署证书后,请勿删除证书存档文件。例如,在升级卫星服务器时,需要它。
-
在有网络访问卫星服务器的计算机中,导航到以下 URL:
\https://satellite.example.com
。 - 在浏览器中,查看证书详情以验证部署的证书。
4.12.3. 将自定义 SSL 证书部署到主机 复制链接链接已复制到粘贴板!
将卫星服务器配置为使用自定义 SSL 证书后,您还必须在注册到此卫星服务器的每个主机上安装 katello-ca-consumer
软件包。
流程
在每个主机上,安装
katello-ca-consumer
软件包:yum localinstall \ http://satellite.example.com/pub/katello-ca-consumer-latest.noarch.rpm
# yum localinstall \ http://satellite.example.com/pub/katello-ca-consumer-latest.noarch.rpm
Copy to Clipboard Copied! Toggle word wrap Toggle overflow