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.Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
8.5. Configuring Access to OSGi Administrative Functions
Overview Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
This tutorial explains how to configure the OSGi administrative functions to use specific roles for authorization. By configuring each of the administrative functions to use a different role for access, you can provide fine grained control over who can monitor and manipulate running containers.
When LDAP is enabled, the OSGi container expects the user role data to be stored along with the user authentication data in the LDAP directory server. The LDAP search query to extract the role data is specified by the
role.* properties in the jaas:module element.
The JAAS LDAP login module used in this tutorial, shown in Example 8.1, “Blueprint JAAS Realm”, is configured to extract the role name from the
cn property of all entries selected by the filter member=uid=%u which is run on the tree selected using the base DN uo=roles,ou=system. In the section called “Adding groups for the roles”, you added three groups to the uo=roles,ou=system tree. The filter will match with any group that has a member specified by uid=%u.
For example, when you attempted to connect to the remote console as user
jdoe the filter searched for a group with a member uid=jdoe and matched on the group cn=admin,uo=roles,ou=system. The LDAP module extracted the cn property's value of admin and used it as the role for authorizing user jdoe.
Goals Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
You will change the role used for each of the administrative functions:
Prerequisites Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
Before you can perfrom any of the following tutorials, you must ensure that the ApacheDS server is running.
Configure a role for the remote console Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
To configure a role for the remote console:
- Open
InstallDir/etc/org.apache.karaf.shell.cfgin a text editor. - Add the following line:
sshRole=sshConsole
sshRole=sshConsoleCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the changes.
- Start Red Hat JBoss Fuse by entering the following command in a terminal window:
> fuse
> fuseCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Open a new command prompt.
- Change directory to the JBoss Fuse install directory.
- Enter the following command to log on to the running container instance using the identity
janedoe:client -u janedoe -p secret
client -u janedoe -p secretCopy to Clipboard Copied! Toggle word wrap Toggle overflow You should successfully log into the container's remote console becausejanedoedoes have thesshConsolerole.
Configure a role for JMX access Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
To configure a role for JMX access:
- Open
InstallDir/etc/org.apache.karaf.management.cfgin a text editor. - Add the following line:
jmxRole=jmxUser
jmxRole=jmxUserCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the changes.
- Start JBoss Fuse by entering the following command in a terminal window:
> fuse
> fuseCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Start JConsole or another JMX console.
- Connect to JBoss Fuse's JMX server using the following settings:
- JMX URL:
service:jmx:rmi://localhost:44444/jndi/rmi://localhost:1099/karaf-root - User:
jdoe - Password:
secret
The connection will fail becausejdoeuser does not have thejmxUserrole. - Connect to JBoss Fuse's JMX server as using the following settings:
- JMX URL:
service:jmx:rmi://localhost:44444/jndi/rmi://localhost:1099/karaf-root - User:
crider - Password:
secret
The connection will succeed becausecrideruser does have thejmxUserrole.
Configure a role for the Web console Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
To configure a role for the Web console:
- If the file
InstallDir/etc/org.apache.karaf.webconsole.cfgdoes not exist create it. - If the file does exist, open in a text editor.
- Edit the line containing
role=to readrole=webconsole.The configuration should resemble Example 8.2, “Web console configuration for a specific realm”.Example 8.2. Web console configuration for a specific realm
<config name="org.apache.karaf.webconsole"> realm=karaf role=webconsole </config>
<config name="org.apache.karaf.webconsole"> realm=karaf role=webconsole </config>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start Red Hat JBoss Fuse by entering the following command in a terminal window:
> fuse
> fuseCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Enable the Web console feature by entering the following command at the JBoss Fuse console prompt:
JBossFuse:karaf@root> features:install webconsole
JBossFuse:karaf@root> features:install webconsoleCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Open a Web browser.
- Navigate to http://localhost:8181/system/console.You will be prompted to enter user credentials.
- Log in using the following credentials:
- User:
janedoe - Password:
secret
You will be logged into the Web console becausejanedoehas the rolewebconsole.
More information Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
For more information on configuring the JBoss Fuse LDAP login module see Section 2.2, “Enabling LDAP Authentication”.
For more information on configuring the JBoss Fuse administrative functions see Section 2.4, “Configuring Roles for the Administrative Protocols”.