Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Chapter 3. Basic Security
Abstract
This chapter describes the basic steps to configure security before you start Red Hat JBoss Fuse for the first time. By default, JBoss Fuse is secure, but none of its services are remotely accessible. This chapter explains how to enable secure access to the ports exposed by JBoss Fuse.
3.1. Configuring Basic Security Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The Red Hat JBoss Fuse runtime is secured against network attack by default, because all of its exposed ports require user authentication and no users are defined initially. In other words, the Red Hat JBoss Fuse runtime is remotely inaccessible by default.
If you want to access the runtime remotely, you must first customize the security configuration, as described here.
Before you start the container Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
If you want to enable remote access to the JBoss Fuse container, perform the following configuration steps before starting the container:
Create a secure JAAS user Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
By default, no JAAS users are defined for the container, which effectively disables remote access (it is impossible to log on).
To create a secure JAAS user, edit the
InstallDir/etc/users.properties file and add a new user field, as follows:
Username=Password,admin
Username=Password,admin
Where
Username and Password are the new user credentials. The admin role gives this user the privileges to access all administration and management functions of the container. For more details about JAAS, see Chapter 15, Configuring JAAS Security.
Warning
It is strongly recommended that you define custom user credentials with a strong password.
Configure the Apache ActiveMQ Web console (optional) Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
If you want to access the Apache ActiveMQ Web console (for remote administration of JMS messaging), you must provide the Web console servlet with the credentials it needs to login to the JMS broker.
Edit the
InstallDir/etc/system.properties file. Search for the activemq.jmx.user and activemq.jmx.password settings (which are commented out by default), and modify them as follows:
# # Authentication - must match an entry in user.properties with the admin privilege # activemq.jmx.user=Username activemq.jmx.password=Password
#
# Authentication - must match an entry in user.properties with the admin privilege
#
activemq.jmx.user=Username
activemq.jmx.password=Password
Where the
Username and Password are the credentials of a JAAS user with admin privileges.
Note
Indirectly, these properties are used to set the
webconsole.jmx.* and webconsole.jms.* properties (in the InstallDir/etc/system.properties file).
Ports exposed by the Red Hat JBoss Fuse container Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Figure 3.1, “Ports Exposed by the Red Hat JBoss Fuse Container” shows the ports exposed by the JBoss Fuse container by default.
Figure 3.1. Ports Exposed by the Red Hat JBoss Fuse Container
The following ports are exposed by the container:
- Console port—enables remote control of a container instance, through Apache Karaf shell commands. This port is enabled by default and is secured both by JAAS authentication and by SSL.
- JMX port—enables management of the container through the JMX protocol. This port is enabled by default and is secured by JAAS authentication.
- Web console port—provides access to an embedded Jetty container that can host Web console servlets. By default, the Web consoles are not installed in the container.
Enabling the remote console port Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
You can access the remote console port whenever both of the following conditions are true:
- JAAS is configured with at least one set of login credentials.
- The JBoss Fuse runtime has not been started in client mode (client mode disables the remote console port completely).
For example, to log on to the remote console port from the same machine where the container is running, enter the following command:
./client -u Username -p Password
./client -u Username -p Password
Where the
Username and Password are the credentials of a JAAS user with admin privileges. For more details, see Chapter 9, Using Remote Connections to Manage a Container.
Strengthening security on the remote console port Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
You can employ the following measures to strengthen security on the remote console port:
- Make sure that the JAAS user credentials have strong passwords.
- Customize the X.509 certificate (replace the Java keystore file,
InstallDir/etc/host.key, with a custom key pair).
Enabling the JMX port Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The JMX port is enabled by default and secured by JAAS authentication. In order to access the JMX port, you must have configured JAAS with at least one set of login credentials. To connect to the JMX port, open a JMX client (for example,
jconsole) and connect to the following JMX URI:
service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root
service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root
You must also provide valid JAAS credentials to the JMX client in order to connect.
Note
In general, the tail of the JMX URI has the format
/karaf-ContainerName. If you change the container name from root to some other name, you must modify the JMX URI accordingly.
Enabling the Web console port Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
All of the Web consoles are installed as servlets in the container's embedded Jetty container. The Web consoles share the same HTTP server port, which is powered by Jetty. You can optionally enable the following Web consoles in JBoss Fuse:
- Karaf Web console—is not installed by default. To enable the Karaf Web console, perform the following steps:
- In a running JBoss Fuse instance (see Section 4.1, “Starting Red Hat JBoss Fuse”), enter the following console command:
JBossFuse:karaf@root> features:install webconsole
JBossFuse:karaf@root> features:install webconsoleCopy to Clipboard Copied! Toggle word wrap Toggle overflow - In a Web browser, navigate to the following URL:
http://localhost:8181/system/console
http://localhost:8181/system/consoleCopy to Clipboard Copied! Toggle word wrap Toggle overflow - The browser will prompt you to log on. Enter valid JAAS user credentials to access the console.
- Apache ActiveMQ Web console—is not installed by default. To enable the Apache ActiveMQ Web console, perform the following steps:
- Make sure that you have already configured the container's Java system properties, as described in the section called “Configure the Apache ActiveMQ Web console (optional)”.NoteThe Apache ActiveMQ Web console has a three tier architecture, as shown in Figure 3.1, “Ports Exposed by the Red Hat JBoss Fuse Container”. The credentials provided in this step enable the middle tier (the Web console servlet) to log on to the back-end tier (the Apache ActiveMQ broker).
- In a running JBoss Fuse instance, enter the following console command:
JBossFuse:karaf@root> features:install mq-web-console
JBossFuse:karaf@root> features:install mq-web-consoleCopy to Clipboard Copied! Toggle word wrap Toggle overflow - In a Web browser, navigate to the following URL:
http://localhost:8181/activemqweb
http://localhost:8181/activemqwebCopy to Clipboard Copied! Toggle word wrap Toggle overflow - The browser will prompt you to log on. Enter valid JAAS user credentials to access the console.
Strengthening security on the Web console port Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The Karaf Web console is already secured by JAAS authentication. To add SSL security, see chapter "Securing the Web Console" in "Security Guide".