SecureTheJmxConsole - JBoss Developer
SecureTheJmxConsole - JBoss Developer
SecureTheJmxConsole Version 52
Created by Unknown User on Feb 8, 2004 5:24 PM. Last modified by David Jorm on Oct 24, 2011 12:57 AM.
Both the jmx-console and web-console are standard servlet 2.3 deployments that can be secured using J2EE role-based security. Both consoles ship with a
skeleton configuration, allowing an administrator to easily enable security using username/password/role mappings found in the jmx-console.war and web-console.war
deployments in the corresponding WEB-INF/classes, users.properties and roles.properties files.
The security setup is based on two pieces: the standard servlet URI to role specification, and the specification of the JAAS configuration which defines how
authentication and role mapping is performed.
In AS 6 M3 and greater deployments, the JSR-160 JMXConnector is opened for remote access and should also be secured.
On JBoss AS 5.x and earlier versions, the web.xml file includes a security-constraint block with flawed settings. The block includes:
<http-method>GET</http-method>
<http-method>POST</http-method>
This configuration will only apply security to the HTTP GET and POST verbs, allowing requests using other HTTP verbs to circumvent security. Please ensure that you
remove the http-method tags from the security-constraint block. Without these tags, security will apply to all HTTP verbs. More details on this flaw are available here
. A JBoss worm is currently in circulation, exploiting this flaw. For more details on the worm, see the statement here.
Remember to pay attention to the important security note - CVE-2010-0738 above. You can use a custom JAAS domain or customize the existing domain in the
same way as with the JMX console. Typically you would just use the same domain as the jmx-console (java:/jaas/jmx-console), so that you have a single user/role
mapping to configure.
If you are unable to login, it may be because another users.properties file is being used. Change the web-console login-config.xml entry so that that properties files are
uniquely named to avoid ambiguity regarding which resource is picked up. You also would need to rename the web-console properties files. For details, see
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=53346 .
As an extra level of security you may also want to Limit Access to Certain Clients in a particular IP address range.
<!-- To enable authentication security checks, uncomment the following security domain name -->
<!--UNCOMMENT THIS
<property name="securityDomain">jmx-console</property>
-->
Change to:
https://developer.jboss.org/wiki/SecureTheJmxConsole 1/7
10/24/2017 SecureTheJmxConsole | JBoss Developer
<!-- To enable authentication security checks, uncomment the following security domain name -->
<property name="securityDomain">jmx-console</property>
Note that the above uses the same security domain as is used for the jmx console.
The and files have been moved to . This is because of the change to use the servlet 2.3 class loading model and these properties files would not be visible to the
other deployments using the jmx-console security domain. You can move the files from to , or leave them in place and edit the password for admin.
Similarly for the web console, please note that the web console is unpacked already in the server configuration as . Proceed to edit the and files as per securing the
JMX console, and either edit the and , or move those files to and edit them there.
and add a <login-config> block after the end of the <security-constraint> block:
01.
01. vi ${jboss.server.home.dir}/deploy/jmx-console.war/WEB-INF/jboss-web.xml
Uncomment the security-domain block. Make sure the JNDI name maps to the realm name (i.e. JMXConsole)
01. vi ${jboss.server.home.dir}/conf/props/jmx-console-users.properties
change the password for admin
01. vi ${jboss.server.home.dir}/deploy/management/console-mgr.sar/web-console.war/WEB-INF/web.xml
uncomment the security-constraint block
and add a <login-config> block after the end of the <security-constraint> block:
01.
01. vi ${jboss.server.home.dir}/deploy/management/console-mgr.sar/web-console.war/WEB-INF/jboss-web.xml
Uncomment the security-domain block. Make sure the JNDI name maps to the realm name (e.g. JMXConsole)
01. vi ${jboss.server.home.dir}/conf/login-config.xml
Change the path to the web-console-users.properties and the web-console-roles.properties as follows (add props/ to the front of the path)
edit as needed
edit ${jboss.server.home.dir}/conf/login-config.xml, find the jmx-console and web-console applicaiton-policy, and set the name to jmx-console and web-console, respectively.
That is make sure that the application policy name maps to the realm name (i.e. JMXConsole)
restart jboss
edit both web.xml to include the following just before end of tag security-constraint
01. <security-constraint>
02. ...
03. <user-data-constraint>
https://developer.jboss.org/wiki/SecureTheJmxConsole 2/7
10/24/2017 SecureTheJmxConsole | JBoss Developer
04. <transport-guarantee>CONFIDENTIAL</transport-guarantee>
05. </user-data-constraint>
06. </security-constraint>
generate /data01/jboss/server/xxxx/conf/keystore and select your own new secure password (@see Creating an SSL Keystore Using the Java Keytool )
01. $ vi /data01/jboss/server/xxx/deploy/jbossweb-tomcat50.sar/server.xml
secure file permission via chmod 600 server.xml
uncomment section "SSL/TLS Connector" to enable Connector port="8443"
replace keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore" with keystoreFile="${jboss.server.home.dir}/conf/keystore"
replace keystorePass="rmi+ssl" sslProtocol = "TLS" /> with keystorePass="<your new secure password>" sslProtocol = "TLS" />
jboss-securejmx.html
18.8 K
(3 ratings)
19 Comments
I created a keystore and verified that it works properly, then uncommented the ssl/port 8443 section of the server.xml and updated the keystore info, but am not
able to connect on port 8443.
If anyone has successfully enabled SSL connections for the web-console, please list the steps here, since they are missing in the Administration and
Configuration document.
jackie Xie May 21, 2010 9:16 PM (in response to Carl Miller)
My SSL is working, steps are same as what you described, here is what I did:
- generate SSL certificate:
keytool -genkey -alias web -keyalg RSA -keystore web.keystore -validity 3650
- copy keystore file to jboss server's home directory, eg. server/default
- modify server.xml file to enable SSL: (..server/default/deploy/jbossweb.sar/server.xml)
* uncomment ssl/port 8443
* update keystore info as:
keystoreFile="${jboss.server.home.dir}/web.keystore"
keystorePass="<keystore password>" sslProtocol="TLS" />
- restart server
I tried this stuff on JBoss 4.2.3 GA, It seems JMX-Console does need any restarts while we configure the BASIC authentication but.. web-console needs
restarts when we configure same as jmx-console..
Does anyboday aware of this.. why do we need to restart the server for enabling security configuration for web-console.. as both jmx and web consoles are in
deploy directory and are hot deployable. ?
https://developer.jboss.org/wiki/SecureTheJmxConsole 3/7
10/24/2017 SecureTheJmxConsole | JBoss Developer
Thanks
Shailesh Dyade
Hi Shailesh,
Is my understanding that the content in ${jboss.server.home.dir}/conf is only loaded at startup so unless you already have this config in your login-
config.xml:
For jboss 5.1.0 the admin console is controlled in admin-console.war/WEB-INF/components.xml, see the security-identity which contains the jaas-config-name.
It seems this overrides the settings in the jboss-web.xml that one would normally use.
Just checking the info in this paragraph (just after the JMX console section:
The process to secure the web console is similar. In the deploy directory, locate and make the same changes as above to to , and the users/groups
properties file. The default JAAS domain used by the web-console is and is defined in in the conf directory. You can use a custom JAAS domain or
customize the existing domain in the same way as with the JMX console. Typically you would just use the same domain (java:/jaas/jmx-console) as the
jmx-console so that you have a single user/role mapping to configurue.
There seems to be information missing from this paragraph. There are instances of "..make changes to above to to", and a similar issue further on in this
paragraph. Could someone please clarify?
Cheers
Jared
It looks like a lot of text went missing in revision 47 of this document. See http://community.jboss.org/wiki/SecureTheJmxConsole/diff?
secondVersionNumber=47
It might be easiest to revert to revision 46 and re-apply the deliberate changes from later revisions.
Sean, you are righ. I have made rev. 47 and rev. 48. But I have just added a few lines and fixed a few mistypes. I do not know, why some text
has been deleted, too.
I have not the permission to restore rev. 46. Is there anyone who can do it? If not, I'll try to bring the deleted text from rev. 46 to the current
version later.
https://developer.jboss.org/wiki/SecureTheJmxConsole 4/7
10/24/2017 SecureTheJmxConsole | JBoss Developer
Hi All,
I have followed these steps exactly but I am still not being prompted for a user name and password! Is there another configuration
elsewhere in JBoss that overrides the application policy? Im using JBoss-5.1.0.GA. Thanks!
I have posted additional details on how determine the configuration and locate the various files in the following article: How to secure the JBoss JMX and Web
Consoles .
Cheers.
Francois
Bhanu Pratap Padmanabhuni Aug 2, 2010 2:19 PM (in response to Francois Andry)
Hi,
I am working on securing the JMX console for JBOSS 4.2.1 and following the below article to make the necessary configuration changes:
http://community.jboss.org/wiki/securetheJmxConsole
But, even after doing the necessary steps and when I tried to login to the JMX console it is not working...I am getting the below error message int he
Jboss server console:
3. {jboss.server.home.dir}/conf/login-config.xml
Changed the path to the web-console-users.properties and the web-console-roles.properties as follows (add props/ to the front of the path)
Restarted my server and tried to login to JMX- Console, it is prompting for the user/pwd but when I give the right one it is giving the above error.
https://developer.jboss.org/wiki/SecureTheJmxConsole 5/7
10/24/2017 SecureTheJmxConsole | JBoss Developer
Bhanu Pratap Padmanabhuni Mar 16, 2011 7:53 AM (in response to Zemian Deng)
1. {jboss.server.home.dir}/deploy/jmx-console.war/WEB-INF/web.xml :
Uncomment the block :<security-constraint> and remove the explicit denial of the GET and POST http methods in accordance with:
https://access.redhat.com/kb/docs/DOC-30741
<security-constraint>
<web-resource-collection>
<web-resource-name>HtmlAdaptor</web-resource-name>
<description>An example security config that only allows users with the
role JBossAdmin to access the HTML JMX console web application
</description>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>JBossAdmin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>jmx-console</realm-name>
</login-config>
<security-role>
<role-name>JBossAdmin</role-name>
</security-role>
2. {jboss.server.home.dir}/deploy/jmx-console.war/WEB-INF/jboss-web.xml
Uncomment the security-domain block:
<security-domain>java:/jaas/jmx-console</security-domain>
{jboss.server.home.dir}/conf/props/jmx-console-users.properties
Eg: admin=admin (or give your own password)
And the file {jboss.server.home.dir}/conf/props/jmx-console-roles.properties should have the below entry (the user mapped to the JBossAdmin role)
admin=JBossAdmin,HttpInvoker
4. {jboss.server.home.dir}/conf/login-config.xml
Change the path to the web-console-users.properties and the web-console-roles.properties as follows (add props/ to the front of the path)
https://developer.jboss.org/wiki/SecureTheJmxConsole 6/7
10/24/2017 SecureTheJmxConsole | JBoss Developer
The only thing I see is
\<jbossRoot>\server\default\deploy\jmx-invoker-service.xml
Hi,
We are running Jboss 5.1.0 GA in production. Please can you advise steps or reference to the documents or community link to the changes (verified) needs to
be done to secure JMX-console and Web-console.
regards
Rajkumar Patel
Hi,
As Rajkumar, I have the same problem, we are running Jbos 5.1.0 GA and zecmd is still loading on our both servers, production and test, is there someone that
has tested this method?, we need to implement it on production server. Thanks for your answers.
Regards,
Felipe Salazar
Could any one precise please which jBoss server versions are affected with this vulnerability ?
Copyright ©2017 Red Hat, Inc. Privacy Statement Terms of Use All policies and guidelines
https://developer.jboss.org/wiki/SecureTheJmxConsole 7/7