导入 SSL 证书
本节介绍如何为新的 SUSE Multi-Linux Manager 安装配置 SSL 证书,以及如何替换现有证书。
在开始之前,请确保已准备好:
-
证书颁发机构 (CA) SSL 公共证书。如果您使用 CA 链,则所有中间 CA 也必须可用。
-
一个 SSL 服务器私用密钥
-
一个 SSL 服务器证书
-
一个 SSL 数据库私用密钥
-
一个 SSL 数据库证书
所有文件必须采用 PEM 格式。
The hostname of the SSL server certificate must match the fully qualified hostname of the machine you deploy them on. You can set the hostnames in the X509v3 Subject Alternative Name section of the certificate. You can also list multiple hostnames if your environment requires it. Supported Key types are RSA and EC (Elliptic Curve).
|
In previous versions the database SSL certificates required |
Third-party authorities commonly use intermediate CAs to sign requested server certificates. In this case, all CAs in the chain are required to be available. The mgrdadm commands are taking care of ordering the certificates. Ideally, the root CA should be in its own file. The server certificate file should contain the server certificate first, followed by all intermediate CA certificates in order.
1. 为新安装导入证书
SUSE Multi-Linux Manager 默认使用自我签名证书。您可以在安装期间导入第三方证书。
Deploy the SUSE Multi-Linux Manager Server according to the instructions in 安装 SUSE Multi-Linux Manager 服务器. Make sure to pass the correct files as parameters to
mgradm install podman. The parameters are:第三方 SSL 证书标志: --ssl-ca-intermediate 字符串 中间 CA 证书路径 --ssl-ca-root 字符串 根 CA 证书路径 --ssl-server-cert 字符串 服务器证书路径 --ssl-server-key 字符串 服务器密钥路径 --ssl-db-ca-intermediate 字符串 数据库的中间 CA 证书路径(如果不同于服务器的相应证书) --ssl-db-ca-root 字符串 数据库的根 CA 证书路径(如果不同于服务器的相应证书) --ssl-db-cert 字符串 数据库证书路径 --ssl-db-key 字符串 数据库密钥路径
中间 CA 可以在使用 --ssl-ca-root 指定的文件中提供,也可以使用 --ssl-ca-intermediate 作为附加选项来指定。可以多次指定 --ssl-ca-intermediate 选项。
2. 为新代理安装导入证书
代理证书已嵌入生成的配置中。如要使用第三方证书,需要在配置过程中提供。
根据 安装 SUSE Multi-Linux Manager 代理 中的说明安装 SUSE Multi-Linux Manager 代理。
按照提示完成设置。
请使用同一证书颁发机构 (CA) 为服务器和代理的所有证书签名。使用不同 CA 签名的证书将不匹配。
3. 替换证书
您可以将 SUSE Multi-Linux Manager 安装环境中的现有有效证书替换为新证书。需要考虑两种场景:仅替换服务器或数据库证书;替换根 CA 证书。
替换根证书需要更多时间并进行更多规划,以避免服务中断,因为在服务器层面切换至新证书前,所有已注册的代理和系统都需要在其数据库中导入新的 CA 证书。
使用由中间 CA 签名的第三方证书时,需要将中间 CA 证书追加至服务器或数据库证书文件中。
证书顺序至关重要:首先是服务器证书,随后依次为对该证书签名的 CA 证书,直至由根 CA 签名的证书。根 CA 证书不应追加至服务器证书文件中。
The following considers that you have
root-ca.pem,intermediate-ca1.pem,intermediate-ca2.pem,server.pemandserver.keyfiles. It may be different depending on the number of intermediate CAs in the server certificate signature chain.Combine the intermediate CAs and server certificates. The order matters, the server must be first and the intermediate CAs in order. Do not add the root CA last into the chain as it will be passed separately to
uyuni-caanduyuni-db-casecrets. If there is no intermediate CA, then you can use theserver.peminstead of the combined file in the next steps.cat server.pem intermediate-ca1.pem intermediate-ca2.pem >combined-server.pem在 SUSE Multi-Linux Manager 容器主机的命令行中,重新创建用于传递文件路径的 Podman 证书机密:
podman secret create --replace uyuni-ca $path_to_ca_certificate podman secret create --replace uyuni-cert $path_to_combined_server_certificate podman secret create --replace uyuni-key $path_to_server_key podman secret create --replace uyuni-db-ca $path_to_database_ca_certificate podman secret create --replace uyuni-db-cert $path_to_combined_database_certificate podman secret create --replace uyuni-db-key $path_to_database_key
在容器主机上,重启服务以应用更改:
mgradm restart
如果您使用的是代理,则需要使用相关代理的主机名和 cname 为每个代理生成一个服务器证书 RPM。生成新的配置 tarball 并进行部署。
有关详细信息,请参见 installation-and-upgrade:container-deployment/mlm/proxy-deployment-mlm.adoc#_generate_proxy_configuration。
如果根 CA 已更改,则需要将其部署至所有连接到 SUSE Multi-Linux Manager 的客户端。理想情况下应提前完成,以最大程度减少服务中断。
|
如果 CA 证书已更新,则需重新打包包含 Kiwi 证书的 RPM 文件。 在 SUSE Multi-Linux Manager 服务器容器主机上,执行以下命令:
完成上述操作后,请在映像构建主机上应用 highstate,以部署新证书供 Kiwi 使用。 |
在 SUSE Multi-Linux Manager Web UI 中,导航到。
选中所有客户端以将其添加到系统集管理器。
导航到。
In the
Statesfield, click Apply to apply the system states.In the
Highstatepage, click Apply Highstate to propagate the changes to the clients.