3.2. 在域控制器和主机控制器之间配置 SSL/TLS
当您将 SSL/TLS 配置为在受管域中 JBoss EAP 实例之间使用时,每个实例都可以具有客户端或服务器角色,具体取决于交互。这包括所有主机控制器和域控制器。因此,建议您在端点之间设置双向 SSL/TLS。
您可以在受管域中配置 JBoss EAP 实例,以便在主域控制器和主机控制器之间相互通信时使用 SSL/TLS。要做到这一点,您需要执行以下操作:
生成并配置所有必要的证书和密钥存储。
要在端点之间设置双向 SSL/TLS,您需要为 master 域控制器以及每个主机控制器生成并配置证书和密钥存储。您还需要将主域控制器的证书导入到每个主机控制器的密钥存储中,并将每个主机控制器的证书导入到主域控制器的密钥存储中。此过程的具体内容包括在为 管理接口设置双Way SSL/TLS 中。
将 master 域控制器配置为使用 SSL/TLS。
配置所有证书和密钥存储后,您需要将安全域配置为使用双向 SSL/TLS。这可以通过将安全域配置为使用 SSL/TLS 并对其进行身份验证来实现。然后,该安全域用于保护用于在主机控制器和主域控制器之间连接的管理接口。
注意以下命令必须以批处理模式运行,或者在添加 ssl 服务器身份后重新加载服务器。下例中使用了批处理模式。
batch /host=master/core-service=management/security-realm=CertificateRealm:add() /host=master/core-service=management/security-realm=CertificateRealm/server-identity=ssl:add(alias=domaincontroller,keystore-relative-to=jboss.domain.config.dir,keystore-path=domaincontroller.jks,keystore-password=secret) /host=master/core-service=management/security-realm=CertificateRealm/authentication=truststore:add(keystore-relative-to=jboss.domain.config.dir,keystore-path=domaincontroller.jks,keystore-password=secret) /host=master/core-service=management/security-realm=CertificateRealm/authentication=local:add(default-user=\$local) /host=master/core-service=management/security-realm=CertificateRealm/authentication=properties:add(relative-to=jboss.domain.config.dir,path=mgmt-users.properties) /host=master/core-service=management/management-interface=native-interface:write-attribute(name=security-realm,value=CertificateRealm) run-batch将所有主机控制器配置为使用 SSL/TLS。
将主域控制器配置为使用双向 SSL/TLS 后,还需要配置每个主机控制器来使用它。此过程与主域控制器配置非常相似,但您需要使用特定于每个主机的密钥存储。
注意以下命令必须以批处理模式运行,或者在添加 ssl 服务器身份后重新加载服务器。下例中使用了批处理模式。
batch /host=instance1/core-service=management/security-realm=CertificateRealm:add() /host=instance1/core-service=management/security-realm=CertificateRealm/server-identity=ssl:add(alias=instance1,keystore-relative-to=jboss.domain.config.dir,keystore-path=instance1.jks,keystore-password=secret) /host=instance1/core-service=management/security-realm=CertificateRealm/authentication=truststore:add(keystore-relative-to=jboss.domain.config.dir,keystore-path=instance1.jks,keystore-password=secret) /host=instance1/core-service=management/security-realm=CertificateRealm/authentication=local:add(default-user="\$local") /host=instance1/core-service=management/security-realm=CertificateRealm/authentication=properties:add(relative-to=jboss.domain.config.dir,path=mgmt-users.properties) /host=instance1/core-service=management/management-interface=native-interface:write-attribute(name=security-realm,value=CertificateRealm) run-batch此外,您需要更新连接主域控制器时使用的安全域。此更改必须在主机控制器的配置文件中直接完成,如
host.xml或host-slave.xml,而服务器没有运行。主机控制器配置文件示例
<domain-controller> <remote security-realm="CertificateRealm" username="slave-user"> <discovery-options> <static-discovery name="primary" protocol="${jboss.domain.master.protocol:remote}" host="${jboss.domain.master.address}" port="${jboss.domain.master.port:9999}"/> </discovery-options> </remote> </domain-controller>警告红帽建议显式禁用 SSLv2、SSLv3 和 TLSv1.0,以便在所有受影响的软件包中明确禁用 TLSv1.1 或 TLSv1.2。