5.7. Configurer la console de gestion pour HTTPS
standalone
ou en domain
. En mode domain
, donnez le préfixe de nom d'hôte aux commandes CLI, par exemple /host=master
.
Procédure 5.2.
Créez un keystore pour sécuriser la console de gestion.
Note
Ce keystore doit être en format JKS car la console de gestion n'est pas compatible avec les keystores en format JCEKS.Dans un émulateur de terminal, saisissez la commande suivante. Pour les paramètresalias
,keypass
,keystore
,storepass
etdname
, remplacez les valeurs en exemple par les valeurs de votre choix.Le paramètrevalidity
indique le nombre de jours pendant la clé est valide. Une valeur de 730 correspondra à deux ans.keytool -genkeypair -alias appserver -storetype jks -keyalg RSA -keysize 2048 -keypass password1 -keystore EAP_HOME/standalone/configuration/identity.jks -storepass password1 -dname "CN=appserver,OU=Sales,O=Systems Inc,L=Raleigh,ST=NC,C=US" -validity 730 -v
keytool -genkeypair -alias appserver -storetype jks -keyalg RSA -keysize 2048 -keypass password1 -keystore EAP_HOME/standalone/configuration/identity.jks -storepass password1 -dname "CN=appserver,OU=Sales,O=Systems Inc,L=Raleigh,ST=NC,C=US" -validity 730 -v
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Veillez à ce que la console de gestion soit bien reliée à HTTPS
Mode autonome
Veillez à ce que la Console de gestion soit reliée àHTTPS
pour son interface en ajoutant la configurationmanagement-https
et en supprimant la configurationmanagement-http
.Assurez vous bien que l'instance JBoss EAP est en cours d'exécution, et saisir les commandes CLI de gestion suivantes :/core-service=management/management-interface=http-interface:write-attribute(name=secure-socket-binding, value=management-https)
/core-service=management/management-interface=http-interface:write-attribute(name=secure-socket-binding, value=management-https)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow /core-service=management/management-interface=http-interface:undefine-attribute(name=socket-binding)
/core-service=management/management-interface=http-interface:undefine-attribute(name=socket-binding)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow La sortie de cette commande sera comme suit :{"outcome" => "success"}
{"outcome" => "success"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
À cet point dans le temps, le journal de JBoss EAP affichera sans doute le message d'erreur suivant. C'est normal car la configuration SSL n'est pas encore terminée.JBAS015103: A secure port has been specified for the HTTP interface but no SSL configuration in the realm.
JBAS015103: A secure port has been specified for the HTTP interface but no SSL configuration in the realm.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Mode Domaine
Modifiez l'élément de socket de la section management-interface en ajoutant secure-port et en supprimant la configuration de port.Assurez vous bien que l'instance JBoss EAP est en cours d'exécution, et saisir les commandes CLI de gestion suivantes :/host=master/core-service=management/management-interface=http-interface:write-attribute(name=secure-port,value=9443) /host=master/core-service=management/management-interface=http-interface:undefine-attribute(name=port)
/host=master/core-service=management/management-interface=http-interface:write-attribute(name=secure-port,value=9443) /host=master/core-service=management/management-interface=http-interface:undefine-attribute(name=port)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
À cet point dans le temps, le journal de JBoss EAP affichera sans doute le message d'erreur suivant. C'est normal car la configuration SSL n'est pas encore terminée.JBAS015103: A secure port has been specified for the HTTP interface but no SSL configuration in the realm.
JBAS015103: A secure port has been specified for the HTTP interface but no SSL configuration in the realm.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Option : personnalisation du groupe de socket-binding
Si vous utilisez un groupesocket-binding
personnalisé, veillez à ce que la liaisonmanagement-https
soit définie (présente par défaut, liée au port9443
). Modifiez le fichier de configuration du master - par exemplestandalone.xml
- pour qu'il puisse correspondre à ce qui suit.<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}"> <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/> <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/> <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}"> <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/> <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/> <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Créer un nouveau domaine de sécurité
Exécutez la commande suivante pour créer un nouveau domaine de sécurité nomméMyDomainRealm
./host=master/core-service=management/security-realm=ManagementRealmHTTPS/:add /host=master/core-service=management/security-realm=ManagementRealmHTTPS/authentication=properties/:add(path=ManagementUsers.properties, relative-to=jboss.domain.config.dir)
/host=master/core-service=management/security-realm=ManagementRealmHTTPS/:add /host=master/core-service=management/security-realm=ManagementRealmHTTPS/authentication=properties/:add(path=ManagementUsers.properties, relative-to=jboss.domain.config.dir)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configurez l'interface de gestion avec le nouveau domaine de sécurité.
Saisir les commandes suivantes :/host=master/core-service=management/management-interface=http-interface/:write-attribute(name=security-realm,value=ManagementRealmHTTPS)
/host=master/core-service=management/management-interface=http-interface/:write-attribute(name=security-realm,value=ManagementRealmHTTPS)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configurez la console de gestion pour qu'elle puisse utiliser le keystore.
Saisissez la commande CLI suivante. Pour les paramètresfile
,password
etalias
, leurs valeurs doivent être copiées à partir de l'étape Create a keystore to secure the management console (Créer un keystore pour sécuriser la console de gestion)./core-service=management/security-realm=ManagementRealmHTTPS/server-identity=ssl:add(keystore-path=identity.jks,keystore-relative-to=jboss.server.config.dir, keystore-password=password1, alias=appserver)
/core-service=management/security-realm=ManagementRealmHTTPS/server-identity=ssl:add(keystore-path=identity.jks,keystore-relative-to=jboss.server.config.dir, keystore-password=password1, alias=appserver)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow La sortie de cette commande sera comme suit :Copy to Clipboard Copied! Toggle word wrap Toggle overflow Démarrez à nouveau le serveur JBoss EAP.
Au redémarrage du serveur, le journal doit contenir ce qui suit, juste avant le texte qui indique le nombre de services démarrés. La console de gestion est maintenant en écoute sur le port 9443, ce qui confirme que la procédure a réussi.14:53:14,720 INFO [org.jboss.as] (Controller Boot Thread) JBAS015962: Http management interface listening on https://127.0.0.1:9443/management 14:53:14,721 INFO [org.jboss.as] (Controller Boot Thread) JBAS015952: Admin console listening on https://127.0.0.1:9443
14:53:14,720 INFO [org.jboss.as] (Controller Boot Thread) JBAS015962: Http management interface listening on https://127.0.0.1:9443/management 14:53:14,721 INFO [org.jboss.as] (Controller Boot Thread) JBAS015952: Admin console listening on https://127.0.0.1:9443
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Note