Chapter 5. Basic Configuration Changes
5.1. Security Configuration
When installed from the zip archive, authentication is required to access the majority of JBoss services, including administrative services. Consoles are secured by the JAAS security domain "jmx-console". At installation, this security domain has no user accounts. This is to eliminate the possibility of default username/password based attacks. Refer to Procedure 5.1, “Create jmx-console, admin-console, and http invoker user account” to create a user account to access the consoles.
When installed via the graphical installer, a JAAS security domain and a user account is created as part of the install process. Even if you change the name of the JAAS security domain during installation, the users are stored in the same place. Follow the instructions in Procedure 5.1, “Create jmx-console, admin-console, and http invoker user account” to edit your user account, or create a new one.
Important
This section describes only basic security configuration. This configuration is not sufficient for use in production environment. Refer to the Security Guide for comprehensive information on how to configure security in JBoss Enterprise Application Platform 5.
Important
The authentication system applied to the JMX Console, Admin Console and Web Console does not block brute-force password attacks. It is recommended that in production environments, JBoss servers are protected by firewalls or reverse proxies that include measures to mitigate brute force attacks.
5.1.1. Security Configuration: JMX Console, Admin Console, HttpInvoker
Procedure 5.1. Create jmx-console, admin-console, and http invoker user account
This procedure creates user with access permissions to the admin and jmx consoles, and the http invoker
Create a user in the default JAAS security domain
- Edit the file
$JBOSS_HOME/server/$PROFILE/conf/props/jmx-console-users.properties
. - Create a username = password pair.
Important
The commentedadmin=admin
username and password pair is an example of the username/password definition syntax. Do not use this for your user account.
Grant permissions to user
- Edit the file
$JBOSS_HOME/server/$PROFILE/conf/props/jmx-console-roles.properties
. - Create an entry for the user of the form:
username=JBossAdmin,HttpInvoker
- JBossAdmin
- Grant the user permission to access the JMX Console and Admin Console.
- HttpInvoker
- Grant the user permission to access the httpinvoker
5.1.2. Securing the HTTPInvoker
The HTTP Invoker is a service that provides HTTP and Remote Method Invocation (RMI) access for EJBs and the JNDI Naming service. Secure this service to prevent unauthorized access.
Procedure 5.2. Secure the HTTP Invoker
- Edit the
<JBOSS_HOME>/server/<PROFILE>/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml
file. - Add the
hostName
andfixedHostName
properties to the deploy/legacy-invokers-service.xml section:<!-- ************ deploy/legacy-invokers-service.xml ************ --> <!-- RMI/JRMP invoker --> <bean class="org.jboss.services.binding.ServiceBindingMetadata"> <property name="serviceName">jboss:service=invoker,type=jrmp</property> <property name="port">4444</property> <property name="description">Socket for the legacy RMI/JRMP invoker</property> <property name="hostName">localhost</property> <property name="fixedHostName">true</property> </bean> <!-- Pooled invoker --> <bean class="org.jboss.services.binding.ServiceBindingMetadata"> <property name="serviceName">jboss:service=invoker,type=pooled</property> <property name="port">4445</property> <property name="description">Socket for the legacy Pooled invoker</property> <property name="hostName">localhost</property> <property name="fixedHostName">true</property> </bean>
5.1.3. Security Configuration: Web Console
Procedure 5.3. Creating Web Console User Account
This procedure creates a user with access permissions to the web console
Create a user in the web-console JAAS security domain.
- Edit the file
web-console-users.properties
injboss-as/server/$PROFILE/deploy/management/console-mgr.sar/web-console.war/WEB-INF/classes/
. - Create a username = password pair.
Important
The commentedadmin=admin
username and password is an example of the username/password definition syntax. Do not use this for your user account.
Grant permissions to the user.
- Edit the file
web-console-roles.properties
injboss-as/server/$PROFILE/deploy/management/console-mgr.sar/web-console.war/WEB-INF/classes/
. - Create an entry for the user of the form:
username=JBossAdmin,HttpInvoker
- JBossAdmin
- Grant the user permission to access the Web-Console
- HttpInvoker
- Grant the user permission to access the HTTP Invoker
5.1.4. Security Configuration of JBoss Messaging
JBoss Messaging makes internal connections between nodes in order to redistribute messages between clustered destinations. These connections are made with the user name of a special reserved user whose password is specified in the property
suckerPassword
in the messaging and server configuration files.
The suckerPassword used by JBoss Messaging in a clustered environment is contained in the
jboss-as/server/$PROFILE/deploy/messaging/messaging-jboss-beans.xml
file and the messaging-service.xml
file. These files contain directives that specify the encrypted suckerPassword
.
Changing the Password in messaging-jboss-beans.xml
Complete this task to change the distribution placeholder password in
messaging-jboss-beans.xml
.
Procedure 5.4. Setting suckerPassword for JBoss Messaging
- Navigate to the
<JBOSS_HOME>/server/<PROFILE>/deploy/messaging/
directory. - Open the
messaging-jboss-beans.xml
file in your preferred text editor. - Change the
suckerPassword
placeholder value from"CHANGE ME!!"
to a plain text password:<property name="suckerPassword">CHANGE ME!!</property>
Make note of the new password; it will be used in the next task. - Save the file.
Creating the encrypted JBoss Messaging suckerPassword
Complete this task to create an encrypted suckerPassword using the JBoss Messaging SecurityUtil tool.
- In a terminal, change to
<JBOSS_HOME>/server/<PROFILE>/deploy/messaging/
. - Run the following command:
/path/to/java/executable -cp JBOSS_HOME/client/jboss-messaging-client.jar org.jboss.messaging.util.SecurityUtil PLAIN_TEXT_PASSWORD
- PLAIN_TEXT_PASSWORD is the password you set in
messaging-jboss-beans.xml
in the previous task.As an example:Example 5.1. Test Encrypted Password
Running the following command (from theJBOSS_HOME/jboss-as/server/$PROFILE/deploy/messaging/
directory) .../usr/bin/java -cp ../../../../client/jboss-messaging-client.jar org.jboss.messaging.util.SecurityUtil test
...produced the following encrypted password:key len: 14 length max: 2147483647 Encoded password: 5e2c1ae5a618317
- Make note of the encrypted password output; it will be used in the next task.
Specifying an encrypted suckerPassword for JBoss Messaging
Complete this task to add an encrypted suckerPassword value to JBoss Messaging configuration files.
Prerequisites
- You have a terminal open at the
<JBOSS_HOME>/server/<PROFILE>/deploy/messaging/
directory.
- In a text editor, open the
messaging-service.xml
file. - Paste the encrypted password from the previous procedure into the
SuckerPassword
attribute:<attribute name="SuckerPassword">ENCRYPTED_PASSWORD</attribute>
- Save the
messaging-service.xml
file.