How to secure jmxServer (JConsole)
I have been trying to secure the JConsole access to my stand-alone Java Server which uses Spring 2.5, but it seems anyone that knows the URL and jmx port can access JConsole without being challenged for login credentials. The Sun docs say that by default authentication is enabled, but it seems not.
http://java.sun.com/j2se/1.5.0/docs/...tml#connecting
Anyway, I have been trying to secure it via spring-jmx-config.xml, since providing JVM parms when launching the server has no effect. Am I on the right track or can somebody tell me what I am doing wrong? The doc says if you give it a non-existent password location you will not have access, but JConsole continues to be wide open...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean class="org.springframework.remoting.rmi.RmiRegistr yFactoryBean">
<property name="port" value="17999"/>
</bean>
<bean id="jmxServer" class="org.springframework.jmx.support.ConnectorSe rverFactoryBean">
<property name="serviceUrl" value="service:jmx:rmi://localhost/jndi/rmi://localhost:17999/Pipeline"/>
<property name="registrationBehaviorName" value="REGISTRATION_REPLACE_EXISTING"/>
<property name="environmentMap">
<map>
<entry key="com.sun.management.jmxremote.authenticate" value-ref="true"/>
<entry key="com.sun.management.jmxremote.password.file" value-ref="foo"/>
</map>
</property>
</bean>
<bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporte r">
....
</bean>
</beans>
Thanks in advance to anyone who can point me in the right direction.
ConnectorServerFactoryBean environment map properties
I tried the JMXAuthenticator approach which was posted, but it seems the poster is using a version of Spring different than 2.5? I am getting errors on the environment map properties for ConnectorServerFactoryBean. Does anyone know where these properties are documented? I am not seeing them documented anywhere...
How to do authorization for an authenticated JMX operation?
I was able to get JMX Authentication working with spring-security using spring-core 3.0.5.RELEASE (see previous message). However, I am still working to figure out how I can get the Authentication object when a @ManagedAttribute is set via a JMX Client like jvisualvm. I need this to determine authorization and access control. Does any one have any suggestions on how I can get the Authentication object when my @ManagedAttribute setter is called from an authenticated JMX client?